Skip to content

Commit

Permalink
Correctly load yarn on Windows machines (#1025)
Browse files Browse the repository at this point in the history
  • Loading branch information
JD557 authored Jan 16, 2024
1 parent 0e1f7bf commit 79466f6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(),
Expand Down

0 comments on commit 79466f6

Please sign in to comment.