Skip to content

Commit

Permalink
fix(task): do not propagate env changes outside subshells (denoland#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret authored and zebreus committed Jul 8, 2024
1 parent 4b7739a commit 5ffa8ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ deno_lockfile.workspace = true
deno_npm = "=0.21.4"
deno_runtime = { workspace = true, features = ["include_js_files_for_snapshotting"] }
deno_semver = "=0.5.6"
deno_task_shell = "=0.16.1"
deno_task_shell = "=0.17.0"
deno_terminal.workspace = true
eszip = "=0.71.0"
napi_sym.workspace = true
Expand Down
6 changes: 3 additions & 3 deletions cli/tools/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ impl ShellCommand for NpmCommand {
}

// fallback to running the real npm command
let npm_path = match context.resolve_command_path("npm") {
let npm_path = match context.state.resolve_command_path("npm") {
Ok(path) => path,
Err(err) => {
let _ = context.stderr.write_line(&format!("{}", err));
Expand All @@ -388,15 +388,15 @@ impl ShellCommand for NpxCommand {
mut context: ShellCommandContext,
) -> LocalBoxFuture<'static, ExecuteResult> {
if let Some(first_arg) = context.args.first().cloned() {
if let Some(command) = context.state.resolve_command(&first_arg) {
if let Some(command) = context.state.resolve_custom_command(&first_arg) {
let context = ShellCommandContext {
args: context.args.iter().skip(1).cloned().collect::<Vec<_>>(),
..context
};
command.execute(context)
} else {
// can't find the command, so fallback to running the real npx command
let npx_path = match context.resolve_command_path("npx") {
let npx_path = match context.state.resolve_command_path("npx") {
Ok(npx) => npx,
Err(err) => {
let _ = context.stderr.write_line(&format!("{}", err));
Expand Down

0 comments on commit 5ffa8ff

Please sign in to comment.