MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / command_output

Function command_output

xtask/src/main.rs:9751–9762  ·  view source on GitHub ↗
(command: &str, args: &[&str], cwd: &Path)

Source from the content-addressed store, hash-verified

9749}
9750
9751fn command_output(command: &str, args: &[&str], cwd: &Path) -> Result<String> {
9752 let output = Command::new(command)
9753 .args(args)
9754 .current_dir(cwd)
9755 .stderr(Stdio::inherit())
9756 .output()
9757 .map_err(|err| anyhow!("failed to spawn {command}: {err}"))?;
9758 if !output.status.success() {
9759 bail!("{command} {} failed with {}", args.join(" "), output.status);
9760 }
9761 String::from_utf8(output.stdout).context("command output was not valid UTF-8")
9762}
9763
9764fn now_micros() -> Result<u128> {
9765 Ok(SystemTime::now()

Calls 2

outputMethod · 0.80
argsMethod · 0.80

Tested by

no test coverage detected