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

1748-support-multiple-dotenv-files #1940

Closed

Conversation

sbeckeriv
Copy link

Dearest Reviewer,

I use more then dotenv for different reasons. I saw the open issue #1748 and took a stab at it. This allow for more then one set value but only for the one type.

It was suggested in the issue to support an array syntax ["file", "file2"]. This is not supported today and I didnt look in to changing the parser to support that.

I did consider supporting a csv value like "file,file2" but I didnt move forward on that.

Some things to note:
It does expect the set lines to be parsed in order. I am unsure if that is true today. It could load files from different subpaths. This could be changed to only load from the path where the first file is found.

I do like that one file or 10 files they all use the same path.

I like using just. Thank you for your work.
Becker

N.B. The test functions::env_var_functions failed for me on master and my branch.

Dearest Reviewer,

I use more then dotenv for different reasons. I saw the open issue and took
a stab at it. This allow for more then one set value but only for the one
type.

It was suggested in the issue to support an array syntax ["file", "file2"].
This is not supported today and I didnt look in to changing the parser to support that.

I did consider supporting a csv value like "file,file2" but I didnt move forward on that.

Some things to note:
It does expect the set lines to be parsed in order. I am unsure if that is true today.
It could load files from different subpaths. This could be changed to only load from the path
where the first file is found.

I do like that one file or 10 files they all use the same path.

I like using just. Thank you for your work.
Becker

N.B. The test functions::env_var_functions failed for me on master and my branch.
@woutervh
Copy link

@casey What is blocking this review? It would be nice to support multiple dotenvs.

@nk9
Copy link
Contributor

nk9 commented Apr 28, 2024

The way this PR works is spelled out in #1748, namely:

just --dotenv-filename=.env --dotenv-filename=.env.local command

or

      ENV := "prod"
      set dotenv-load
      set dotenv-filename := ".env"
      set dotenv-filename := ".env.local"
      set dotenv-filename := ".env.{{ENV}}"
      set dotenv-path := "path"

I personally think this syntax is a bit confusing since it seems like you're replacing the filename, when in fact all the files will be loaded sequentailly. I think the array syntax described in the original issue would be much clearer.

@sbeckeriv
Copy link
Author

@nk9 thanks for the feedback. I will close this.

@sbeckeriv sbeckeriv closed this Apr 29, 2024
@sbeckeriv sbeckeriv deleted the 1748-support-multiple-dotenv-files branch May 1, 2024 20:48
@sbeckeriv sbeckeriv mentioned this pull request May 20, 2024
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.

3 participants