aw-lights/build.rs
2021-08-21 17:21:50 -04:00

25 lines
575 B
Rust

use std::process::Command;
fn main() {
let profile = std::env::var("PROFILE").unwrap();
Command::new("npm")
.current_dir("./liveview-rust/js")
.args(&["run-script", "build"])
.env(
"NODE_ENV",
match profile.as_str() {
"release" => "production",
"debug" => "development",
r => panic!("Unknown release type: {}", r),
},
)
.spawn()
.unwrap()
.wait()
.unwrap()
.success()
.then(|| ())
.unwrap()
}