about summary refs log tree commit diff
path: root/kittybox-rs/build.rs
blob: c9d6bfebe61a272aa2fad7da27c9f8500fbc951d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
fn main() {
    use std::env;
    let out_dir = env::var("OUT_DIR").unwrap();
    println!("cargo:rerun-if-changed=javascript/");
    eprintln!("Out dir: {out_dir}");

    let mut child = std::process::Command::new("tsc")
        .arg("--outDir")
        .arg(out_dir)
        .current_dir("javascript")
        .spawn()
        .unwrap();

    if let Ok(exit) = child.wait() {
        if !exit.success() {
            std::process::exit(exit.code().unwrap_or(1))
        }
    }
}