Skip to content

Commit 226cb3c

Browse files
committed
Improve error reporting in web/build.rs
1 parent febed54 commit 226cb3c

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

web/build.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,21 @@ fn main() {
1616
] {
1717
println!("cargo:rerun-if-changed={tracked_file}");
1818
}
19-
let vite_status = Command::new("yarn")
19+
20+
let mut vite_command = Command::new("yarn");
21+
vite_command
2022
.arg("run")
2123
.arg("build")
2224
.arg("--outDir")
2325
.arg(&vite_out_dir)
2426
.arg("--base")
25-
.arg("/ui/")
26-
.status()
27-
.unwrap();
28-
if !vite_status.success() {
29-
panic!("web-ui build failed: {vite_status}");
30-
}
27+
.arg("/ui/");
28+
let vite_status = vite_command.status();
29+
match vite_status {
30+
Ok(vite_status) if vite_status.success() => {}
31+
_ => panic!("web-ui build failed: command {vite_command:?} resulted in {vite_status:?}"),
32+
};
33+
3134
let mut asset_map = phf_codegen::Map::new();
3235
for asset_file in vite_out_dir.join("assets").read_dir().unwrap() {
3336
let asset_file = asset_file.unwrap();

0 commit comments

Comments
 (0)