auric 0.1.6

CLI for the Ember-inspired Auric SPA framework
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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(())
}