File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -36,19 +36,19 @@ function loadEnvFile(filePath: string) {
3636const nodeEnv = process . env . NODE_ENV || 'development' ;
3737console . log ( `🌍 Environment: ${ nodeEnv } ` ) ;
3838
39- // Load environment-specific config first (public values, production only)
40- if ( nodeEnv === 'production' ) {
41- const envFile = join ( process . cwd ( ) , '.env.production' ) ;
42- loadEnvFile ( envFile ) ;
43- }
44-
45- // Load .env file with secrets and local config (overrides public config if any)
46- // Required for DISCORD_TOKEN and other secrets
47- const localEnvFile = join ( process . cwd ( ) , '.env' ) ;
48- loadEnvFile ( localEnvFile ) ;
49-
5039if ( nodeEnv === 'test' ) {
5140 console . log ( '🧪 Loading test environment variables' ) ;
5241 const testEnvFile = join ( process . cwd ( ) , '.env.test' ) ;
5342 loadEnvFile ( testEnvFile ) ;
43+ } else {
44+ // Load environment-specific config first (public values, production only)
45+ if ( nodeEnv === 'production' ) {
46+ const envFile = join ( process . cwd ( ) , '.env.production' ) ;
47+ loadEnvFile ( envFile ) ;
48+ }
49+
50+ // Load .env file with secrets and local config (overrides public config if any)
51+ // Required for DISCORD_TOKEN and other secrets
52+ const localEnvFile = join ( process . cwd ( ) , '.env' ) ;
53+ loadEnvFile ( localEnvFile ) ;
5454}
You can’t perform that action at this time.
0 commit comments