diff --git a/justfile b/justfile index 2d0eb77..ea10cfa 100644 --- a/justfile +++ b/justfile @@ -1,3 +1,4 @@ +set windows-shell := ["powershell.exe", "-NoLogo", "-Command"] default: just --list diff --git a/project/src/build.runner.scala b/project/src/build.runner.scala index 52afae8..b7dd96c 100644 --- a/project/src/build.runner.scala +++ b/project/src/build.runner.scala @@ -1,3 +1,5 @@ +import java.util.Locale + import scala.concurrent.duration.* import fs2.* @@ -22,6 +24,9 @@ sealed trait BuildTool class ScalaCli extends BuildTool class Mill extends BuildTool +private lazy val isWindows: Boolean = + System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows") + def buildRunner( tool: BuildTool, linkingTopic: Topic[IO, Unit], @@ -66,7 +71,7 @@ def buildRunnerScli( .flatMap( _ => ProcessBuilder( - "scala-cli", + if isWindows then "scala-cli.bat" else "scala-cli", scalaCliArgs ).withWorkingDirectory(workDir) .spawn[IO] @@ -135,7 +140,7 @@ def buildRunnerMill( ) ++ extraBuildArgs // TODO pipe this to stdout so that we can see linker progress / errors. val builder = ProcessBuilder( - "mill", + if isWindows then "mill.bat" else "mill", millargs ).withWorkingDirectory(workDir) .spawn[IO]