fix: panic if target unknown
This commit is contained in:
parent
d961bf6fae
commit
fdf0e608dc
1 changed files with 5 additions and 3 deletions
8
build.rs
8
build.rs
|
@ -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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue