File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 11import { initAdmin } from 'shared/init-admin'
2- import { loadSecretsToEnv } from 'common/secrets'
32import { createSupabaseDirectClient , type SupabaseDirectClient , } from 'shared/supabase/init'
4- import { getServiceAccountCredentials } from "shared/firebase-utils" ;
5-
6- initAdmin ( )
3+ import { refreshConfig } from "common/envs/prod" ;
74
85export const runScript = async (
96 main : ( services : { pg : SupabaseDirectClient } ) => Promise < any > | any
107) => {
11- const credentials = getServiceAccountCredentials ( )
12-
13- await loadSecretsToEnv ( credentials )
8+ initAdmin ( )
9+ await initEnvVariables ( )
10+ console . debug ( 'Environment variables in runScript:' )
11+ for ( const k of Object . keys ( process . env ) ) console . debug ( `${ k } =${ process . env [ k ] } ` )
1412
13+ console . debug ( 'runScript: creating pg client...' )
1514 const pg = createSupabaseDirectClient ( )
15+ console . debug ( 'runScript: running main...' )
1616 await main ( { pg} )
17+ }
18+
1719
18- process . exit ( )
20+ export async function initEnvVariables ( ) {
21+ const { config} = await import ( 'dotenv' )
22+ config ( { path : __dirname + '/../../.env' } )
23+ refreshConfig ( )
1924}
You can’t perform that action at this time.
0 commit comments