pub fn run_verify(
mana_dir: &Path,
id: &str,
) -> Result<Option<VerifyResult>, Error>Expand description
Run the verify command for a unit without closing it.
Loads the unit, resolves the effective timeout (unit override → config default), spawns the verify command in a subprocess, and captures all output.
Returns Ok(None) if the unit has no verify command.
§Errors
anyhow::Error— unit not found, spawn failure, or I/O error
§Example
use mana_core::api::run_verify;
use std::path::Path;
match run_verify(Path::new("/project/.mana"), "1").unwrap() {
Some(result) => {
if result.passed {
println!("Verify passed (exit {:?})", result.exit_code);
} else {
eprintln!("Verify failed:\n{}", result.stderr);
}
}
None => println!("No verify command"),
}