Merge pull request #1461 from arittner/buildonwindows-cmd

Build: Fix shell script run under Windows OS
This commit is contained in:
eikek
2022-03-21 21:05:38 +01:00
committed by GitHub
2 changed files with 12 additions and 9 deletions

View File

@ -23,8 +23,14 @@ object Cmd {
}
def exec(cmd: Seq[String], wd: Option[File]): Result = {
val command =
sys.props.get("os.name") match {
case Some(name) if name.toLowerCase.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"))
}