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

make order of precedence in setting environment know in docs, and consider changing #5

Open
toddzebert opened this issue May 12, 2016 · 3 comments

Comments

@toddzebert
Copy link

Given the line current(make(process.env.NODE_ENV || argv.env || "development")); if NODE_ENV is set to anything truthy it'll use that regardless of any other method (as the or is short-circuited) of setting the environment, and otherwise it'll fall to arg.env in the same way, and so forth. Make this clear in the documentation. Also, if NODE_ENV is set to "development" then not even gulp.task('set-prod', production.task); or environments.current(production); will override it

Plus, I think it should be reversed, command line should override NODE_ENV or code, and code should override NODE_ENV.

Thanks for the module!

@calvinjuarez
Copy link
Contributor

I'm adding my voice here to note that now, in 2019, I'd also like the command line argument to take priority over an environment variable.

I disagree that code should be overridden by command-line argument. I think code should probably be the strongest, personally. But in any case, it's absolutely weird that environment variable wins.

calvinjuarez added a commit to calvinjuarez/gulp-environments that referenced this issue Oct 1, 2019
@calvinjuarez
Copy link
Contributor

With precedence now listed in the README, this is probably ready to close.

@toddzebert
Copy link
Author

I haven't used this package in years so I'm probably not a good choice to decide if my original issue is still an issue or not.

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