27 lines
597 B
Rust
Raw Normal View History

2021-08-22 00:14:45 -04:00
use std::process::Command;
fn main() {
let profile = std::env::var("PROFILE").unwrap();
let success = Command::new("npm")
2021-08-22 00:14:45 -04:00
.current_dir("./js")
2022-11-17 15:58:55 -05:00
.args(["run-script", "build"])
2021-08-22 00:14:45 -04:00
.env(
"NODE_ENV",
match profile.as_str() {
"release" => "production",
"debug" => "development",
r => panic!("Unknown release type: {}", r),
},
)
.spawn()
.unwrap()
.wait()
.unwrap()
.success();
if !success {
panic!("Npm build failed");
}
2021-08-22 00:14:45 -04:00
}