2022-11-17 15:58:55 -05:00

27 lines
597 B
Rust

use std::process::Command;
fn main() {
let profile = std::env::var("PROFILE").unwrap();
let success = Command::new("npm")
.current_dir("./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();
if !success {
panic!("Npm build failed");
}
}