1 parent
286def05c1
commit
7dd818db68
7 files changed
+170
-24
No files matched your search
@@ -2,6 +2,10 @@ use std::process::Command;
|
||||
|
||||
use anyhow::{Context, anyhow, bail};
|
||||
|
||||
/// Spawn a subprocess with arguments.
|
||||
///
|
||||
/// Collects `stdout` and returns it on success.
|
||||
/// Returns `Err` if the exit code isn't 0, or if the process failed to spawn.
|
||||
pub fn cmd(cmd: &[&str]) -> anyhow::Result<String> {
|
||||
let [cmd, args @ ..] = cmd else {
|
||||
bail!("missing command");
|
||||
|
||||
Reference in new issue
Block a user