hive-bash-mcp: find env on PATH where /usr/bin/env is missing, so the runner tests run in the nix sandbox
This commit is contained in:
parent
7d28227fee
commit
431cb6e77f
1 changed files with 9 additions and 1 deletions
|
|
@ -762,7 +762,15 @@ async fn exec_cmd(
|
||||||
// `kill` and the timeout would have nothing left to act on.
|
// `kill` and the timeout would have nothing left to act on.
|
||||||
let stdout_file = std::fs::File::create(out_path)?;
|
let stdout_file = std::fs::File::create(out_path)?;
|
||||||
let stderr_file = std::fs::File::create(err_path)?;
|
let stderr_file = std::fs::File::create(err_path)?;
|
||||||
let mut cmd_builder = Command::new("/usr/bin/env");
|
//
|
||||||
|
// Where `/usr/bin/env` does not exist (the nix build sandbox, which the
|
||||||
|
// tests run in, has only `/bin/sh`), `env` is looked up on PATH instead.
|
||||||
|
let env = if Path::new("/usr/bin/env").exists() {
|
||||||
|
"/usr/bin/env"
|
||||||
|
} else {
|
||||||
|
"env"
|
||||||
|
};
|
||||||
|
let mut cmd_builder = Command::new(env);
|
||||||
cmd_builder
|
cmd_builder
|
||||||
.arg("bash")
|
.arg("bash")
|
||||||
.arg("-c")
|
.arg("-c")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue