-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feature: add --dotenv arg #327
Conversation
Can you share use case? Seems very specific. |
e.g. setup and helper scripts in a project with environment specific or secret configurations (e.g. db secrets, NODE_ENV, ports, etc).
or doing stuff depending on NODE_ENV
etc. So something like |
As no more interest was shown, let’s not merge it now. Probably we can discuss adding such feature later. |
Alright, in case anyone needs it, I've pushed my version with this PR here: https://www.npmjs.com/package/zxenv |
Hello! I am really interested to use a For the moment I'll probably use this work-around: #119 (comment) In a bash script I used to do: # Load .env
export $(egrep -v '^#' .env | xargs) |
This is great, please reopen. |
I really feel this should be supported.
Those all should come from environment variables if you want to track these files. Although I believe it should auto detect any |
What about just adding to the script: import 'dotenv/config' That's it. Nothing else is required.
Definitely not support this. Things should be explicit. |
This requires to have a |
Interesting. Can you tell little bit more? |
For example, we have a folder structure which is related to DevOps. |
I see. This makes sense. |
Let’s open a new issue and discuss implementation there c |
Not sure if you desire to have this inbuilt, but to me its pretty much essential to preload env files before running commands. I'm sure others would welcome this.
Feature
Add an argument to load .env files prior to running the script.
Issues
NPM packages people seemed to publish to add this feature
Done