21 lines
568 B
Rust
21 lines
568 B
Rust
|
use std::process::Command;
|
||
|
// use std::io::{ErrorKind,Error};
|
||
|
// use std::error::Error;
|
||
|
|
||
|
fn main() {
|
||
|
let profile = std::env::var("PROFILE").unwrap();
|
||
|
|
||
|
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().then(|| ()).unwrap()
|
||
|
}
|