Build: Fix shell script run under Windows OS

This commit is contained in:
Aljoscha Rittner
2022-03-20 13:22:00 +01:00
parent f2a2d15e7f
commit 92079fe2e0
2 changed files with 12 additions and 9 deletions

View File

@ -23,8 +23,13 @@ object Cmd {
}
def exec(cmd: Seq[String], wd: Option[File]): Result = {
val command =
sys.props.get("os.name").getOrElse("").toLowerCase match {
case win if win.startsWith("windows") => Seq ("cmd", "/C") ++ cmd
case _ => cmd
}
val capt = new Capture
val rc = Process(cmd, wd).!(capt.logger)
val rc = Process(command, wd).!(capt.logger)
Result(rc, capt.out.get.mkString("\n"), capt.err.get.mkString("\n"))
}