fix: panic if target unknown

This commit is contained in:
Max Coppen 2022-11-01 18:19:17 +01:00
parent d961bf6fae
commit fdf0e608dc

View file

@ -13,17 +13,19 @@ fn main() {
"tauri/tooling/api/src/mocks.ts", "tauri/tooling/api/src/mocks.ts",
]; ];
if cfg!(target_os = "windows") { if cfg!(windows) {
/* Use cmd if the target is windows */ /* Use cmd if the target is windows */
Command::new("cmd") Command::new("cmd")
.args(&["/C", "esbuild"]) .args(&["/C", "esbuild"])
.args(&sargs) .args(&sargs)
.output() .output()
.unwrap(); .unwrap();
} else { } else if cfg!(unix) {
Command::new("esbuild") Command::new("esbuild")
.args(&sargs) .args(&sargs)
.output() .output()
.unwrap(); .unwrap();
}; } else {
panic!("Unsupported build target");
}
} }