~skye/sbse/build.rs

view raw


use std::{
    fs::File,
    io::{self, Write},
    process::Command,
};

fn main() -> io::Result<()> {
    println!("cargo::rerun-if-changed=pre.cal");

    match Command::new("cali")
        .args(&["-t", "pre.cal"])
        .output()
    {
        Ok(x) => File::create("./src/lib.rs")?.write_all(&x.stdout)?,
        Err(e) => eprintln!("{e}"),
    };

    Ok(())

}