use anyhow::anyhow;
use std::path::Path;
use std::process::Command;
pub(crate) fn run_make(workspace: &Path) -> anyhow::Result<()> {
eprintln!("==> make");
let output = Command::new("make").current_dir(workspace).output()?;
for line in output.stderr.split(|&c| c == b'\n') {
let line = String::from_utf8(line.to_vec())?;
eprintln!("{line}");
}
if !output.status.success() {
return Err(anyhow!("{}", String::from_utf8(output.stderr.to_vec())?));
}
Ok(())
}