diff options
| author | Asher Gomez <ashersaupingomez@gmail.com> | 2023-11-02 02:21:13 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-01 15:21:13 +0000 |
| commit | f8f4e776325efe0d8dd50207beecb425f0875999 (patch) | |
| tree | f8781d719f6e980fe34dcf415e607e2826692573 /cli/tests/testdata | |
| parent | 53248e9bb3123a1b684f3f9f744bb671dfa53bc1 (diff) | |
feat(unstable): `deno run --env` (#20300)
This change adds the `--env=[FILE]` flag to the `run`, `compile`,
`eval`, `install` and `repl` subcommands. Environment variables set in
the CLI overwrite those defined in the `.env` file.
Diffstat (limited to 'cli/tests/testdata')
| -rw-r--r-- | cli/tests/testdata/env | 4 | ||||
| -rw-r--r-- | cli/tests/testdata/run/env_file.out | 4 | ||||
| -rw-r--r-- | cli/tests/testdata/run/env_file.ts | 3 |
3 files changed, 11 insertions, 0 deletions
diff --git a/cli/tests/testdata/env b/cli/tests/testdata/env new file mode 100644 index 000000000..c41732d30 --- /dev/null +++ b/cli/tests/testdata/env @@ -0,0 +1,4 @@ +FOO=BAR +ANOTHER_FOO=ANOTHER_${FOO} +MULTILINE="First Line +Second Line"
\ No newline at end of file diff --git a/cli/tests/testdata/run/env_file.out b/cli/tests/testdata/run/env_file.out new file mode 100644 index 000000000..54a0bf25d --- /dev/null +++ b/cli/tests/testdata/run/env_file.out @@ -0,0 +1,4 @@ +BAR +ANOTHER_BAR +First Line +Second Line diff --git a/cli/tests/testdata/run/env_file.ts b/cli/tests/testdata/run/env_file.ts new file mode 100644 index 000000000..48488ce72 --- /dev/null +++ b/cli/tests/testdata/run/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")); |
