Watch
0
0
Fork
You've already forked hyperhive
0

hive-subagent-mcp: write the fake-claude test script via write_executable

This commit is contained in:
damocles 2026-10-08 02:01:04 +02:00
commit 04a8e2b328

View file

@ -3578,18 +3578,14 @@ mod tests {
/// EOF, so `RunningClaude::wait` would not return until the orphaned
/// sleep expired, and the turn would look like it was still running.
fn fake_claude(dir: &Path, log: &Path) -> PathBuf {
use std::os::unix::fs::PermissionsExt as _;
let script = dir.join("fake-claude");
std::fs::write(
write_executable(
&script,
format!(
&format!(
"#!/bin/sh\necho turn >> '{}'\ntrap 'exit 0' INT\nsleep 30 >/dev/null 2>&1 &\nwait\n",
log.display()
),
)
.expect("write the fake claude");
std::fs::set_permissions(&script, std::fs::Permissions::from_mode(0o755))
.expect("make the fake claude executable");
);
script
}