Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit ee35b29

Browse files
committed
Fix sbt gui task on windows
1 parent e31016d commit ee35b29

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

project/BuildUtility.scala

+10-2
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ class BuildUtility(logger: ManagedLogger) {
256256

257257
logger info "Installing GUI dependencies."
258258

259-
val exitCode = new ProcessBuilder("npm", "install")
259+
val exitCode = new ProcessBuilder(getNpmCommand :+ "install": _*)
260260
.inheritIO()
261261
.directory(guiDir)
262262
.start()
@@ -293,7 +293,7 @@ class BuildUtility(logger: ManagedLogger) {
293293

294294
logger info "Building GUI."
295295

296-
val buildExitCode = new ProcessBuilder("npm", "run", "build")
296+
val buildExitCode = new ProcessBuilder(getNpmCommand :+ "run" :+ "build": _*)
297297
.inheritIO()
298298
.directory(guiDir)
299299
.start()
@@ -316,6 +316,14 @@ class BuildUtility(logger: ManagedLogger) {
316316
build(inputs).headOption
317317
}
318318

319+
private def getNpmCommand: List[String] = {
320+
if (System.getProperty("os.name").toLowerCase().contains("win")) {
321+
List("cmd.exe", "/C", "npm")
322+
} else {
323+
List("npm")
324+
}
325+
}
326+
319327
/**
320328
* Creates a file listing with all files including files in any sub-dir.
321329
*

0 commit comments

Comments
 (0)