From 60b25535efaf23baa6a8a00e3509d9b43a4cdc06 Mon Sep 17 00:00:00 2001 From: antecrescent Date: Fri, 28 Jun 2024 13:00:38 +0200 Subject: [PATCH] Make SvelteCheck and ViteTest respect YARN_BINARY (#3231) --- build/ninja_gen/src/node.rs | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/build/ninja_gen/src/node.rs b/build/ninja_gen/src/node.rs index 5e527c830..853e6f24b 100644 --- a/build/ninja_gen/src/node.rs +++ b/build/ninja_gen/src/node.rs @@ -214,16 +214,13 @@ pub struct SvelteCheck { impl BuildAction for SvelteCheck { fn command(&self) -> &str { - if cfg!(windows) { - "cmd /c yarn svelte-check:once" - } else { - "./yarn svelte-check:once" - } + "$yarn svelte-check:once" } fn files(&mut self, build: &mut impl build::FilesHandle) { build.add_inputs("svelte-check", inputs![":node_modules:svelte-check"]); build.add_inputs("tsconfig", &self.tsconfig); + build.add_inputs("yarn", inputs![":yarn:bin"]); build.add_inputs("", &self.inputs); build.add_inputs("", inputs!["yarn.lock"]); build.add_variable( @@ -298,15 +295,12 @@ pub struct ViteTest { impl BuildAction for ViteTest { fn command(&self) -> &str { - if cfg!(windows) { - "cmd /c yarn vitest:once" - } else { - "./yarn vitest:once" - } + "$yarn vitest:once" } fn files(&mut self, build: &mut impl build::FilesHandle) { build.add_inputs("vitest", inputs![":node_modules:vitest"]); + build.add_inputs("yarn", inputs![":yarn:bin"]); build.add_inputs("", &self.deps); build.add_output_stamp("tests/vitest"); } @@ -457,11 +451,7 @@ pub struct SveltekitBuild { impl BuildAction for SveltekitBuild { fn command(&self) -> &str { if std::env::var("HMR").is_err() { - if cfg!(windows) { - "cmd /c yarn build" - } else { - "$yarn build" - } + "$yarn build" } else { "echo" }