1use std::process::Command;
2
3fn main() {
4 let output = Command::new("npm")
5 .current_dir("../../styles")
6 .args(["install", "--no-save"])
7 .output()
8 .expect("failed to run npm");
9 if !output.status.success() {
10 panic!(
11 "failed to install theme dependencies {}",
12 String::from_utf8_lossy(&output.stderr)
13 );
14 }
15
16 let output = Command::new("npm")
17 .current_dir("../../styles")
18 .args(["run", "build"])
19 .output()
20 .expect("failed to run npm");
21 if !output.status.success() {
22 panic!(
23 "build script failed {}",
24 String::from_utf8_lossy(&output.stderr)
25 );
26 }
27
28 println!("cargo:rerun-if-changed=../../styles/src");
29}