From 79466f65bf3c4c36b010614d13b4685c41dc2772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Costa?= Date: Tue, 16 Jan 2024 17:15:50 +0100 Subject: [PATCH] Correctly load yarn on Windows machines (#1025) --- build.sbt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index e39955efc..132fa353b 100644 --- a/build.sbt +++ b/build.sbt @@ -278,13 +278,17 @@ lazy val storage = project ) .dependsOn(api.jvm(ScalaVersions.jvm), utils, instrumentation) +lazy val yarnBin = + if (scala.util.Properties.isWin) "yarn.cmd" + else "yarn" + lazy val client = project .enablePlugins(ScalablyTypedConverterExternalNpmPlugin) .settings(baseNoCrossSettings) .settings(baseJsSettings) .settings( externalNpm := { - Process("yarn", baseDirectory.value.getParentFile) ! ProcessLogger(line => ()) + Process(yarnBin, baseDirectory.value.getParentFile) ! ProcessLogger(line => ()) baseDirectory.value.getParentFile }, stFlavour := Flavour.ScalajsReact, @@ -298,7 +302,7 @@ lazy val client = project scalaJSLinkerConfig.value.withModuleKind(ModuleKind.ESModule) }, yarnBuild := { - Process("yarn build").! + Process(s"$yarnBin build").! }, test := {}, Test / loadedTestFrameworks := Map(),