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

strip export statement to be compatible with other dotenv implementation #293

Closed
wants to merge 1 commit into from

Conversation

florisvink
Copy link

Dotenv autoloaders like oh-my-zsh needs the explicit shell export statement at the beginning of the line. This PR handles these .env files as well.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 7e2b2d3 on OOShoppingnl:master into ad86907 on motdotla:master.

@maxbeatty
Copy link
Contributor

😕 the dotenv plugin you linked to says "export is optional"

This has been proposed a number of times and the thinking is still to support a consistent INI file format and encourage other modules that build on top of it from there

@maxbeatty maxbeatty closed this Mar 26, 2018
@dosentmatter
Copy link

dosentmatter commented Apr 20, 2018

If anyone wants to allow exporting all variables in the .env file, you can do the following:

set -a # Turn on allexport
. ./.env # source .env
set +a # Turn off allexport

set -a is POSIX compliant so it should work with most shells. Then you just don't include the optional export for all dotenv implementations.

Repository owner deleted a comment from eropple Jun 2, 2019
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

Successfully merging this pull request may close these issues.

None yet

4 participants