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

Provide a global binary which can load .env into the current shell environment. #488

Closed
liudonghua123 opened this issue Aug 21, 2020 · 3 comments

Comments

@liudonghua123
Copy link

I want to load the environment variables from a .env file into the current shell. From the docs, I could not find how can I achieve it. If this package could provide a global binary like dotenv then I can execute it like dotenv --dotenv_config_path=.env.

@zenflow
Copy link

zenflow commented Aug 21, 2020

@liudonghua123
Copy link
Author

@zenflow Maybe this feature would be impossible to implement. The closest way to achieve this feature would create a new child process, and pass the envs into it.

You can also execute source .env directly in Unix/Linux or generate a temp bat file which contains a batch of set command, invoke it If you are using Windows cmd.

See more details in the following references.

@motdotla
Copy link
Owner

motdotla commented May 5, 2021

Thanks for the thoughts here @liudonghua123. I'm going to go ahead and close this. If others take an interest in this beyond dotenv-cli, then it will be something we consider.

@motdotla motdotla closed this as completed May 5, 2021
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

3 participants