From 624e3a04e7eb92d5ce3536cec653d7aae92df5b5 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 27 Mar 2024 13:19:25 -0400 Subject: [PATCH] feat(task): cross-platform shebang support (#23091) Adds cross-platform shebang support (supports using shebangs in `deno task` on Windows) https://github.com/denoland/deno_task_shell/pull/113 --- Cargo.lock | 13 +++++++------ cli/Cargo.toml | 2 +- cli/tools/task.rs | 12 ++++++++---- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 075ee0816aba1f..d8d9736a1b3056 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1832,9 +1832,9 @@ dependencies = [ [[package]] name = "deno_task_shell" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4721cc23c43e05a8dce807ed322320b3538ce9a60d131c50b2301b14c984a9d4" +checksum = "6b44af10161906e1bccc1fc966f074bec0148997bb7e2221ecd29416dcad90b3" dependencies = [ "anyhow", "futures", @@ -1842,6 +1842,7 @@ dependencies = [ "monch", "os_pipe", "path-dedot", + "thiserror", "tokio", "tokio-util", ] @@ -6584,18 +6585,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index c252cd9b1ae485..12a45aa430ba3b 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -74,7 +74,7 @@ deno_lockfile.workspace = true deno_npm = "=0.17.0" deno_runtime = { workspace = true, features = ["include_js_files_for_snapshotting"] } deno_semver = "=0.5.4" -deno_task_shell = "=0.15.0" +deno_task_shell = "=0.16.0" deno_terminal.workspace = true eszip = "=0.64.2" napi_sym.workspace = true diff --git a/cli/tools/task.rs b/cli/tools/task.rs index 124d760dbd6efe..8f500df3435544 100644 --- a/cli/tools/task.rs +++ b/cli/tools/task.rs @@ -299,8 +299,10 @@ impl ShellCommand for NpmPackageBinCommand { }, ]; args.extend(context.args); - let executable_command = - deno_task_shell::ExecutableCommand::new("deno".to_string()); + let executable_command = deno_task_shell::ExecutableCommand::new( + "deno".to_string(), + std::env::current_exe().unwrap(), + ); executable_command.execute(ShellCommandContext { args, ..context }) } } @@ -324,8 +326,10 @@ impl ShellCommand for NodeModulesFileRunCommand { self.path.to_string_lossy().to_string(), ]; args.extend(context.args); - let executable_command = - deno_task_shell::ExecutableCommand::new("deno".to_string()); + let executable_command = deno_task_shell::ExecutableCommand::new( + "deno".to_string(), + std::env::current_exe().unwrap(), + ); // set this environment variable so that the launched process knows the npm command name context .state