-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
feat(cli): support multiple env file argument #26527
Changes from 5 commits
741da5c
ee9671b
a46f609
a2a512d
a283ff8
13d4763
4e5bd6c
a6433bc
114a63b
ac09628
df0cea4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -428,6 +428,11 @@ itest!(env_file_missing { | |
output: "run/env_file_missing.out", | ||
}); | ||
|
||
itest!(env_file_multiple { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could I actually ask you to rewrite these three There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, will do so thank you for pointing it out. |
||
args: "run --env=env --env=env_one --env=env_two --allow-env run/multiple_env_file.ts", | ||
output: "run/multiple_env_file.out", | ||
}); | ||
|
||
itest!(lock_write_fetch { | ||
args: | ||
"run --quiet --allow-import --allow-read --allow-write --allow-env --allow-run run/lock_write_fetch/main.ts", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FOO=BARBAR | ||
ANOTHER_FOO=OVERRIDEN_BY_ENV_ONE |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FOO=OVERRIDEN_BY_ENV_TWO |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
OVERRIDEN_BY_ENV_TWO | ||
OVERRIDEN_BY_ENV_ONE | ||
First Line | ||
Second Line |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
console.log(Deno.env.get("FOO")); | ||
console.log(Deno.env.get("ANOTHER_FOO")); | ||
console.log(Deno.env.get("MULTILINE")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we allow specifying multiple values in a single declaration as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @crowlKats , before this PR the behavior was that if multiple declaration of the same variable exists in the .env file, the first one was applied. For example:
For the above single env file,
VAR='one'
would take effect, and this behavior remains the same while passing multiple env file but according to order of files passed, that is if the above was the last file passed and other preceding file also had VAR in it, then 'VAR='one'' is applied.Please suggest, if this is something that we are looking or any anything else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no what i meant multiple files in a single flag call, as in
--env-file=.env.one,.env.two
in addition to allowing multiple calls to--env-file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, that is achievable using the delimiter flag in clap I guess. Do you want me to update the code @crowlKats ?