From 1f75f8829384a6526fc1dc19cee0dc2f1594d1cf Mon Sep 17 00:00:00 2001 From: Igor Katson Date: Mon, 12 Aug 2024 21:05:59 +0100 Subject: [PATCH] Trying npm.exe on windows --- crates/librqbit/build.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/librqbit/build.rs b/crates/librqbit/build.rs index d55f8ed..6c63258 100644 --- a/crates/librqbit/build.rs +++ b/crates/librqbit/build.rs @@ -10,10 +10,16 @@ fn main() { println!("cargo:rerun-if-changed={}", webui_src_dir.to_str().unwrap()); + #[cfg(not(target_os = "windows"))] + let npm = "npm"; + + #[cfg(target_os = "windows")] + let npm = "npm.exe"; + // Run "npm install && npm run build" in the webui directory for (cmd, args) in [ - ("npm", ["install"].as_slice()), - ("npm", ["run", "build"].as_slice()), + (npm, ["install"].as_slice()), + (npm, ["run", "build"].as_slice()), ] { // Run "npm install" in the webui directory let output = Command::new(cmd)