hive-subagent-mcp: write the fake-claude test script via write_executable
This commit is contained in:
parent
70644cb004
commit
04a8e2b328
1 changed files with 3 additions and 7 deletions
|
|
@ -3578,18 +3578,14 @@ mod tests {
|
||||||
/// EOF, so `RunningClaude::wait` would not return until the orphaned
|
/// EOF, so `RunningClaude::wait` would not return until the orphaned
|
||||||
/// sleep expired, and the turn would look like it was still running.
|
/// sleep expired, and the turn would look like it was still running.
|
||||||
fn fake_claude(dir: &Path, log: &Path) -> PathBuf {
|
fn fake_claude(dir: &Path, log: &Path) -> PathBuf {
|
||||||
use std::os::unix::fs::PermissionsExt as _;
|
|
||||||
let script = dir.join("fake-claude");
|
let script = dir.join("fake-claude");
|
||||||
std::fs::write(
|
write_executable(
|
||||||
&script,
|
&script,
|
||||||
format!(
|
&format!(
|
||||||
"#!/bin/sh\necho turn >> '{}'\ntrap 'exit 0' INT\nsleep 30 >/dev/null 2>&1 &\nwait\n",
|
"#!/bin/sh\necho turn >> '{}'\ntrap 'exit 0' INT\nsleep 30 >/dev/null 2>&1 &\nwait\n",
|
||||||
log.display()
|
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
|
script
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue