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 multiple .env files with direnv #2180

Open
ahochsteger opened this issue Jul 4, 2024 · 0 comments
Open

Support multiple .env files with direnv #2180

ahochsteger opened this issue Jul 4, 2024 · 0 comments
Labels
feature New feature or request triage Issue needs triage

Comments

@ahochsteger
Copy link

What problem are you trying to solve?

Many development setups I work with use more than one .env file - most commonly one that contains values that are shared among all developers and thus committed into GIT and one that is private and thus excluded from .gitignore.
devbox currently does not support such kind of setups, since devbox generate direnv does not allow to pass multiple env files.

What solution would you like?

direnv already allows to do that using by just listing multiple .env files in .envrc like this:

dotenv_if_exists .env.shared
dotenv_if_exists .env

If the command devbox generate direnv would allow to specify --env-file multiple times and put them in the given order into the generated .envrc file and also output them in the given order when the option --print-envrc is used, then everything would just work as expected.

Alternatives you've considered

Passing multiple --env-file arguments has been tried but that did not work as it just uses the last given one.
A workaround is to manually write the .envrc file but that means a lot of extra manual work in every affected git repository and the risk to lose the good integration by not conforming to the recommended direnv setup anymore.

@ahochsteger ahochsteger added feature New feature or request triage Issue needs triage labels Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request triage Issue needs triage
Development

No branches or pull requests

1 participant