1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00

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
This commit is contained in:
David Sherret 2024-03-27 13:19:25 -04:00 committed by GitHub
parent 726ddabf1f
commit 624e3a04e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 11 deletions

13
Cargo.lock generated
View file

@ -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",

View file

@ -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

View file

@ -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