Skip to content

Commit

Permalink
feat(task): cross-platform shebang support (#23091)
Browse files Browse the repository at this point in the history
Adds cross-platform shebang support (supports using shebangs in `deno
task` on Windows)

denoland/deno_task_shell#113
  • Loading branch information
dsherret committed Mar 27, 2024
1 parent 726ddab commit 624e3a0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
13 changes: 7 additions & 6 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 @@ -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
Expand Down
12 changes: 8 additions & 4 deletions cli/tools/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}
}
Expand All @@ -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
Expand Down

0 comments on commit 624e3a0

Please sign in to comment.