From fdf0e608dc38561fa866cf56c3ed37c2fa3ad506 Mon Sep 17 00:00:00 2001 From: Max Coppen <44031065+mxcop@users.noreply.github.com> Date: Tue, 1 Nov 2022 18:19:17 +0100 Subject: [PATCH] fix: panic if target unknown --- build.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build.rs b/build.rs index 64cff85..f0eae84 100644 --- a/build.rs +++ b/build.rs @@ -13,17 +13,19 @@ fn main() { "tauri/tooling/api/src/mocks.ts", ]; - if cfg!(target_os = "windows") { + if cfg!(windows) { /* Use cmd if the target is windows */ Command::new("cmd") .args(&["/C", "esbuild"]) .args(&sargs) .output() .unwrap(); - } else { + } else if cfg!(unix) { Command::new("esbuild") .args(&sargs) .output() .unwrap(); - }; + } else { + panic!("Unsupported build target"); + } }