diff options
author | Bhuwan Pandit <bhuwanpandit109@gmail.com> | 2024-11-17 22:49:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-17 22:49:35 +0000 |
commit | cff6e280c77afb0bc42a10348eeef5360db8f361 (patch) | |
tree | a6920ecc1358b23661145b3c03607787a04ae9c6 /tests/testdata | |
parent | 73411bb98a677727799122ebc397d825bf95b812 (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/testdata')
-rw-r--r-- | tests/testdata/env_unparsable | 4 | ||||
-rw-r--r-- | tests/testdata/run/env_file.out | 4 | ||||
-rw-r--r-- | tests/testdata/run/env_file.ts | 3 | ||||
-rw-r--r-- | tests/testdata/run/env_file_missing.out | 4 |
4 files changed, 0 insertions, 15 deletions
diff --git a/tests/testdata/env_unparsable b/tests/testdata/env_unparsable deleted file mode 100644 index 5542b80bc..000000000 --- a/tests/testdata/env_unparsable +++ /dev/null @@ -1,4 +0,0 @@ -FOO=valid -ANOTHER_FOO=c:\path -MULTILINE="First Line -Second Line"
\ No newline at end of file diff --git a/tests/testdata/run/env_file.out b/tests/testdata/run/env_file.out deleted file mode 100644 index 54a0bf25d..000000000 --- a/tests/testdata/run/env_file.out +++ /dev/null @@ -1,4 +0,0 @@ -BAR -ANOTHER_BAR -First Line -Second Line diff --git a/tests/testdata/run/env_file.ts b/tests/testdata/run/env_file.ts deleted file mode 100644 index 48488ce72..000000000 --- a/tests/testdata/run/env_file.ts +++ /dev/null @@ -1,3 +0,0 @@ -console.log(Deno.env.get("FOO")); -console.log(Deno.env.get("ANOTHER_FOO")); -console.log(Deno.env.get("MULTILINE")); diff --git a/tests/testdata/run/env_file_missing.out b/tests/testdata/run/env_file_missing.out deleted file mode 100644 index f50c1789e..000000000 --- a/tests/testdata/run/env_file_missing.out +++ /dev/null @@ -1,4 +0,0 @@ -Warning The `--env-file` flag was used, but the environment file specified 'missing' was not found. -undefined -undefined -undefined |