Fix build so it works on Windows

This commit is contained in:
Eugene Yokota 2017-12-19 00:17:46 -05:00
parent ec5bdc2381
commit c920919c2c
1 changed files with 2 additions and 2 deletions

View File

@ -34,6 +34,7 @@ def buildLevelSettings: Seq[Setting[_]] =
scmInfo := Some(ScmInfo(url("https://github.com/sbt/sbt"), "git@github.com:sbt/sbt.git")),
resolvers += Resolver.mavenLocal,
scalafmtOnCompile := true,
scalafmtOnCompile in Sbt := false,
scalafmtVersion := "1.3.0",
))
@ -463,10 +464,9 @@ lazy val sbtIgnoredProblems = {
}
def runNpm(command: String, base: File, log: sbt.internal.util.ManagedLogger) = {
val npm = if (sbt.internal.util.Util.isWindows) "npm.cmd" else "npm"
import scala.sys.process._
try {
val exitCode = Process(s"$npm $command", Option(base)) ! log
val exitCode = Process(s"npm $command", Option(base)) ! log
if (exitCode != 0) throw new Exception("Process returned exit code: " + exitCode)
} catch {
case e: java.io.IOException => log.warn("failed to run npm " + e.getMessage)