-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_convex_env.sh
More file actions
executable file
·41 lines (33 loc) · 1.01 KB
/
setup_convex_env.sh
File metadata and controls
executable file
·41 lines (33 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# Function to load environment variables from a file
load_env_file() {
local file=$1
[ ! -f "$file" ] && return
while IFS='=' read -r key value; do
# Skip empty lines and comments
[[ -z "$key" || "$key" =~ ^[[:space:]]*# ]] && continue
# Trim whitespace
key=$(echo "$key" | xargs)
value=$(echo "$value" | xargs)
# Remove quotes if present
value="${value%\"}"
value="${value#\"}"
export "$key=$value"
done < "$file"
}
# Load environment variables from .env
load_env_file .env
# Check if CLERK_JWT_ISSUER_DOMAIN is set
if [ -z "$CLERK_JWT_ISSUER_DOMAIN" ]; then
echo "Error: CLERK_JWT_ISSUER_DOMAIN not found in .env"
exit 1
fi
echo "Setting CLERK_JWT_ISSUER_DOMAIN in Convex to: $CLERK_JWT_ISSUER_DOMAIN"
# Set the environment variable in Convex
export CLERK_JWT_ISSUER_DOMAIN
if bunx convex env set CLERK_JWT_ISSUER_DOMAIN="$CLERK_JWT_ISSUER_DOMAIN" 2>&1; then
echo "✓ Successfully set CLERK_JWT_ISSUER_DOMAIN in Convex"
else
echo "Error setting CLERK_JWT_ISSUER_DOMAIN in Convex"
exit 1
fi