-
-
Notifications
You must be signed in to change notification settings - Fork 867
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
Should environment specific values override globals? #5
Comments
Just to clarify, my use case is that I'm using Foreman to run my node site and its dependencies. Foreman loads in .env files, so it's convenient to be able to set overrides for a testing environment in a |
Why wouldn't you set your overrides directly in I'm trying to understand the need for the different environment files (see other comment) |
This should be looked at as inspiration: bkeepers/dotenv#4 |
Maybe I'm misunderstanding, but it seems like that thread is implying it works as I've suggested. They're saying that env variables cannot be overwritten if they already exist. And since it loads the environment specific file first, then when a value is present in both I think what's missing from this project is that the environment variables can be overwritten. I'd imagine adding something like this in main.js would work?
(edit: you'd actually want to explicitly check for undefined to account for falsy values, but you get the idea) |
Interesting. Yeah, I am reading it the other way. I'm going to test out ruby's dotenv and see how it is doing that. I'll match the library up to however it's working in the ruby version. |
@jessefulton you were correct. version |
I haven't dug too deep into the ruby version, but based on the rails implementation shouldn't environment-specific environments override the global? ie., values in
.env.development
should override the same variables (if defined) that are in the main.env
file.Currently, the opposite is true. Changing this is just a matter of reversing the order of the calls in the main
load()
method.Is this a bug, or am I expecting it to work backwards?
The text was updated successfully, but these errors were encountered: