diff options
Diffstat (limited to 'www/deno/files/patch-cli_task_runner.rs')
-rw-r--r-- | www/deno/files/patch-cli_task_runner.rs | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/www/deno/files/patch-cli_task_runner.rs b/www/deno/files/patch-cli_task_runner.rs index 76acf2d2c1c5..80552ae82f98 100644 --- a/www/deno/files/patch-cli_task_runner.rs +++ b/www/deno/files/patch-cli_task_runner.rs @@ -1,17 +1,27 @@ Index: cli/task_runner.rs --- cli/task_runner.rs.orig +++ cli/task_runner.rs -@@ -243,7 +243,8 @@ impl ShellCommand for NpmCommand { +@@ -248,7 +248,8 @@ impl ShellCommand for NpmCommand { ); return ExecutableCommand::new( "deno".to_string(), - std::env::current_exe().unwrap(), + std::env::current_exe() -+ .unwrap_or_else(|_| PathBuf::from("LOCALBASE/bin/deno")), ++ .unwrap_or_else(|_| PathBuf::from("PREFIX/bin/deno")), ) .execute(ShellCommandContext { args, -@@ -307,12 +308,16 @@ impl ShellCommand for NodeCommand { +@@ -277,7 +278,8 @@ impl Default for DenoCommand { + fn default() -> Self { + Self(ExecutableCommand::new( + "deno".to_string(), +- std::env::current_exe().unwrap(), ++ std::env::current_exe() ++ .unwrap_or_else(|_| PathBuf::from("PREFIX/bin/deno")), + )) + } + } +@@ -326,12 +328,16 @@ impl ShellCommand for NodeCommand { OsStr::new(USE_PKG_JSON_HIDDEN_ENV_VAR_NAME), OsStr::new("1"), ); @@ -24,7 +34,7 @@ Index: cli/task_runner.rs + ExecutableCommand::new( + "deno".to_string(), + std::env::current_exe() -+ .unwrap_or_else(|_| PathBuf::from("LOCALBASE/bin/deno")), ++ .unwrap_or_else(|_| PathBuf::from("PREFIX/bin/deno")), + ) + .execute(ShellCommandContext { + args, @@ -34,23 +44,23 @@ Index: cli/task_runner.rs } } -@@ -400,7 +405,8 @@ impl ShellCommand for NpmPackageBinCommand { +@@ -425,7 +431,8 @@ impl ShellCommand for NpmPackageBinCommand { args.extend(context.args); let executable_command = deno_task_shell::ExecutableCommand::new( "deno".to_string(), - std::env::current_exe().unwrap(), + std::env::current_exe() -+ .unwrap_or_else(|_| PathBuf::from("LOCALBASE/bin/deno")), ++ .unwrap_or_else(|_| PathBuf::from("PREFIX/bin/deno")), ); executable_command.execute(ShellCommandContext { args, ..context }) } -@@ -427,7 +433,8 @@ impl ShellCommand for NodeModulesFileRunCommand { +@@ -452,7 +459,8 @@ impl ShellCommand for NodeModulesFileRunCommand { args.extend(context.args); let executable_command = deno_task_shell::ExecutableCommand::new( "deno".to_string(), - std::env::current_exe().unwrap(), + std::env::current_exe() -+ .unwrap_or_else(|_| PathBuf::from("LOCALBASE/bin/deno")), ++ .unwrap_or_else(|_| PathBuf::from("PREFIX/bin/deno")), ); // set this environment variable so that the launched process knows the npm command name context.state.apply_env_var( |