summaryrefslogtreecommitdiff
path: root/tests/specs/run/env_file/env_file.ts
diff options
context:
space:
mode:
authorBhuwan Pandit <bhuwanpandit109@gmail.com>2024-11-17 22:49:35 +0000
committerGitHub <noreply@github.com>2024-11-17 22:49:35 +0000
commitcff6e280c77afb0bc42a10348eeef5360db8f361 (patch)
treea6920ecc1358b23661145b3c03607787a04ae9c6 /tests/specs/run/env_file/env_file.ts
parent73411bb98a677727799122ebc397d825bf95b812 (diff)
feat(cli): support multiple env file argument (#26527)
Closes #26425 ## Overview This PR adds support for specifying multiple environment files as arguments when using the Deno CLI. Subsequent files override pre-existing variables defined in previous files. If the same variable is defined in the environment and in the file, the value from the environment takes precedence. ## Example Usage ```bash deno run --allow-env --env-file --env-file=".env.one" --env-file=".env.two" script.ts ``` --------- Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'tests/specs/run/env_file/env_file.ts')
-rw-r--r--tests/specs/run/env_file/env_file.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/specs/run/env_file/env_file.ts b/tests/specs/run/env_file/env_file.ts
new file mode 100644
index 000000000..48488ce72
--- /dev/null
+++ b/tests/specs/run/env_file/env_file.ts
@@ -0,0 +1,3 @@
+console.log(Deno.env.get("FOO"));
+console.log(Deno.env.get("ANOTHER_FOO"));
+console.log(Deno.env.get("MULTILINE"));