SIGN IN SIGN UP
denoland / deno UNCLAIMED

A modern runtime for JavaScript and TypeScript.

0 0 17 Rust

feat(task): support --env-file flag (#34508)

`deno task` had no `--env-file` flag, so loading dotenv files into a
task's shell environment required forwarding `--env-file` through every
individual `deno run`/`deno install`/etc. inside the task body. This
adds the flag at the task level, matching how `run`, `eval`, `test`, `serve`,
and other runtime subcommands already accept it.

The loader machinery is already global (`cli/lib.rs` reads
`flags.env_file` at startup and mutates the process env), so the spawned task shell
inherits the variables for free. The flag accepts a default path
(`.env`), an explicit path, or multiple paths with later files taking precedence,
consistent with the other subcommands.

Closes #27236
B
Bartek Iwańczuk committed
04dc1ec9acc110fe79f5c238c9d7cfc95565c40b
Parent: a6fd15f
Committed by GitHub <noreply@github.com> on 6/1/2026, 11:10:25 AM