Skip to content

Commit 488d97c

Browse files
committed
Fix .env fallback
1 parent 75316d4 commit 488d97c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/utils/get-env.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ import type { DeploymentEnv, EnvVarMap } from '../types/types'
55
export const getEnvVarMap = async (deploymentEnv: DeploymentEnv, varNameList?: string[]) => {
66
let envVarMap: EnvVarMap
77

8-
if (await exists(`.env.${deploymentEnv}`) ?? await exists('.env')) {
9-
envVarMap = await GetEnvVars({ envFile: { filePath: `.env.${deploymentEnv}`, fallback: true } })
8+
if (await exists(`.env.${deploymentEnv}`)) {
9+
envVarMap = await GetEnvVars({ envFile: { filePath: `.env.${deploymentEnv}` } })
10+
}
11+
else if (await exists('.env')) {
12+
envVarMap = await GetEnvVars({ envFile: { filePath: '.env' } })
1013
}
1114
else {
1215
envVarMap = await GetEnvVars({ rc: { environments: [deploymentEnv] } })

0 commit comments

Comments
 (0)