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

Tcosgrove debug prod env vars #758

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docker-run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

ls -al envs
APP_ENV=$APP_ENV yarn build:preview && yarn start
4 changes: 4 additions & 0 deletions packages/env-loader/src/env-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ const loadEnvVarsFromPath = (path: string): EnvVars => {
export const getEnvFileVars = (appEnv?: string): EnvVars => {
// Load env vars from `.env.${process.env.APP_ENV}` if it exists,
// otherwise load env vars from `.env.local` if it exists.
// eslint-disable-next-line no-console
console.log(`appEnv is ${appEnv}`)
if (appEnv && fs.existsSync(`envs/.env.${appEnv}`)) {
// eslint-disable-next-line no-console
console.log(`we are trying to read envs/.env.${appEnv}`)
return loadEnvVarsFromPath(`envs/.env.${appEnv}`)
} else if (fs.existsSync('envs/.env.local')) {
return loadEnvVarsFromPath(`envs/.env.local`)
Expand Down
Loading