Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle expo env vars in bootstrap. #2118

Merged
merged 3 commits into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions internal/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ const (
POSTGRES_DATABASE = "POSTGRES_DATABASE"
NEXT_PUBLIC_SUPABASE_ANON_KEY = "NEXT_PUBLIC_SUPABASE_ANON_KEY"
NEXT_PUBLIC_SUPABASE_URL = "NEXT_PUBLIC_SUPABASE_URL"
EXPO_PUBLIC_SUPABASE_ANON_KEY = "EXPO_PUBLIC_SUPABASE_ANON_KEY"
EXPO_PUBLIC_SUPABASE_URL = "EXPO_PUBLIC_SUPABASE_URL"
)

func writeDotEnv(keys []api.ApiKeyResponse, config pgconn.Config, fsys afero.Fs) error {
Expand Down Expand Up @@ -246,8 +248,12 @@ func writeDotEnv(keys []api.ApiKeyResponse, config pgconn.Config, fsys afero.Fs)
case POSTGRES_DATABASE:
initial[k] = config.Database
case NEXT_PUBLIC_SUPABASE_ANON_KEY:
fallthrough
case EXPO_PUBLIC_SUPABASE_ANON_KEY:
sweatybridge marked this conversation as resolved.
Show resolved Hide resolved
initial[k] = initial[SUPABASE_ANON_KEY]
case NEXT_PUBLIC_SUPABASE_URL:
fallthrough
case EXPO_PUBLIC_SUPABASE_URL:
sweatybridge marked this conversation as resolved.
Show resolved Hide resolved
initial[k] = initial[SUPABASE_URL]
default:
initial[k] = v
Expand Down