From 0f4041c927a5e995e9c58ae482a8d2cc2c9acaee Mon Sep 17 00:00:00 2001 From: thorwebdev Date: Thu, 4 Apr 2024 12:28:22 +0800 Subject: [PATCH 1/2] chore: handle expo env vars in bootstrap. --- internal/bootstrap/bootstrap.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/bootstrap/bootstrap.go b/internal/bootstrap/bootstrap.go index ac9279bb8..b70c0c0fc 100644 --- a/internal/bootstrap/bootstrap.go +++ b/internal/bootstrap/bootstrap.go @@ -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 { @@ -246,8 +248,10 @@ func writeDotEnv(keys []api.ApiKeyResponse, config pgconn.Config, fsys afero.Fs) case POSTGRES_DATABASE: initial[k] = config.Database case NEXT_PUBLIC_SUPABASE_ANON_KEY: + case EXPO_PUBLIC_SUPABASE_ANON_KEY: initial[k] = initial[SUPABASE_ANON_KEY] case NEXT_PUBLIC_SUPABASE_URL: + case EXPO_PUBLIC_SUPABASE_URL: initial[k] = initial[SUPABASE_URL] default: initial[k] = v From 319dea1e726981dfa4b5cbf508fb90925b7c4b2d Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Thu, 4 Apr 2024 14:44:19 +0800 Subject: [PATCH 2/2] Apply suggestions from code review --- internal/bootstrap/bootstrap.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/bootstrap/bootstrap.go b/internal/bootstrap/bootstrap.go index b70c0c0fc..3bfe41a58 100644 --- a/internal/bootstrap/bootstrap.go +++ b/internal/bootstrap/bootstrap.go @@ -248,9 +248,11 @@ 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: initial[k] = initial[SUPABASE_ANON_KEY] case NEXT_PUBLIC_SUPABASE_URL: + fallthrough case EXPO_PUBLIC_SUPABASE_URL: initial[k] = initial[SUPABASE_URL] default: