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

Support sourcing environment variables from .env files #36

Open
0x326 opened this issue Nov 12, 2019 · 1 comment
Open

Support sourcing environment variables from .env files #36

0x326 opened this issue Nov 12, 2019 · 1 comment

Comments

@0x326
Copy link

0x326 commented Nov 12, 2019

Some project support loading environment variables from .env files to allow permanent variables to be committed and shared among project members. Examples include create-react-app and Docker Compose. I think it would be great if yarnhook did as well. That way, a project team could share a variable such as YARNHOOK_DRYRUN=true without requiring each member to set it in a global .bashrc file.

Though this may seem to limit individual preference in environment variables, yarnhook could also recognize .env.local, which overrides .env and is usually listed in .gitignore

@frontsideair
Copy link
Owner

frontsideair commented Oct 16, 2020

I think this is an easy change to make, but I wonder if it warrants adding a dependency. Current environment flags act like one-off settings and I can't see a team using a .env file to set them project-wide.

On the other hand, in case of YARNHOOK_DRYRUN flag, if this is actually used by a project to only suggest reinstalling dependencies, we can use a configuration file (maybe cosmiconfig) and make it configurable this way.

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