mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 10:28:27 +00:00
Build: Fix shell script run under Windows OS
This commit is contained in:
12
build.sbt
12
build.sbt
@ -1,5 +1,4 @@
|
|||||||
import com.github.eikek.sbt.openapi._
|
import com.github.eikek.sbt.openapi._
|
||||||
import scala.sys.process._
|
|
||||||
import com.typesafe.sbt.SbtGit.GitKeys._
|
import com.typesafe.sbt.SbtGit.GitKeys._
|
||||||
import docspell.build._
|
import docspell.build._
|
||||||
import de.heikoseeberger.sbtheader.CommentBlockCreator
|
import de.heikoseeberger.sbtheader.CommentBlockCreator
|
||||||
@ -997,13 +996,12 @@ def compileElm(
|
|||||||
logger.info("Compile elm files ...")
|
logger.info("Compile elm files ...")
|
||||||
val target =
|
val target =
|
||||||
outBase / "META-INF" / "resources" / "webjars" / artifact / version / "docspell-app.js"
|
outBase / "META-INF" / "resources" / "webjars" / artifact / version / "docspell-app.js"
|
||||||
val cmd = Seq("elm", "make") ++ mode.flags ++ Seq("--output", target.toString)
|
val cmd = (Seq("elm", "make")
|
||||||
val proc = Process(
|
++ mode.flags
|
||||||
cmd ++ Seq(wd / "src" / "main" / "elm" / "Main.elm").map(_.toString),
|
++ Seq("--output", target.toString)
|
||||||
Some(wd)
|
++ Seq(wd / "src" / "main" / "elm" / "Main.elm").map(_.toString)
|
||||||
)
|
)
|
||||||
val out = proc.!!
|
Cmd.run(cmd, wd, logger)
|
||||||
logger.info(out)
|
|
||||||
val targetGZ = file(target.toString + ".gz")
|
val targetGZ = file(target.toString + ".gz")
|
||||||
IO.gzip(target, targetGZ)
|
IO.gzip(target, targetGZ)
|
||||||
Seq(target, targetGZ)
|
Seq(target, targetGZ)
|
||||||
|
@ -23,8 +23,13 @@ object Cmd {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def exec(cmd: Seq[String], wd: Option[File]): Result = {
|
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 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"))
|
Result(rc, capt.out.get.mkString("\n"), capt.err.get.mkString("\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user