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

Loading Priorities not working as documented with multiple files scenario: .env .secrets #96

Open
xmlking opened this issue May 1, 2024 · 2 comments
Assignees

Comments

@xmlking
Copy link

xmlking commented May 1, 2024

I am trying following scenario:
Loading Priorities works : .env, .env.local, .env.prod <--- this works for .env
Loading Priorities not working with two files: .env, .env.local, .env.prod, .secrets, .secrets.prod <-- this not working with both .env and .secrets files

Expected MY_SECRET=prod (which is defined in .secrets.prod) but got MY_SECRET=dev (which is defined in .secrets)

NODE_ENV=prod dotenv-run -f .env -f .secrets -v '.*' -u            
---------------------------------
- Root directory:  /Users/xxx/Work/SPA/signals
- Working directory:  /Users/xxx/Work/SPA/signals
- Files: .env, .secrets
- Environment: prod
- Environment files: 
 ✔ /Users/xxx/Work/SPA/signals/.env.prod
 ✔ /Users/xxx/Work/SPA/signals/.env.local
 ✔ /Users/xxx/Work/SPA/signals/.env
 ✔ /Users/xxx/Work/SPA/signals/.secrets.prod
 ✔ /Users/xxx/Work/SPA/signals/.secrets
- Environment variables: .* (Unsecure Mode)
@xmlking
Copy link
Author

xmlking commented May 1, 2024

image image image image image

@chihab chihab self-assigned this May 31, 2024
@chihab
Copy link
Owner

chihab commented May 31, 2024

Expected MY_SECRET=prod (which is defined in .secrets.prod) but got MY_SECRET=dev (which is defined in .secrets)

I guess here MY_SECRET is rather defined in one of the .env.* files which are loaded before as the output shows.

What is the debug output (the loading priorities) you expect:

NODE_ENV=prod dotenv-run -f .env -f .secrets -v '.*' -u            
---------------------------------
- Root directory:  /Users/xxx/Work/SPA/signals
- Working directory:  /Users/xxx/Work/SPA/signals
- Files: .env, .secrets
- Environment: prod
- Environment files: 
???
- Environment variables: .* (Unsecure Mode)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants