Skip to content

Commit dc2bb47

Browse files
committed
Fix executable paths on Windows
1 parent 4e4b42d commit dc2bb47

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

justfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
12

23
default:
34
just --list

project/src/build.runner.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import java.util.Locale
2+
13
import scala.concurrent.duration.*
24

35
import fs2.*
@@ -22,6 +24,9 @@ sealed trait BuildTool
2224
class ScalaCli extends BuildTool
2325
class Mill extends BuildTool
2426

27+
private lazy val isWindows: Boolean =
28+
System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows")
29+
2530
def buildRunner(
2631
tool: BuildTool,
2732
linkingTopic: Topic[IO, Unit],
@@ -66,7 +71,7 @@ def buildRunnerScli(
6671
.flatMap(
6772
_ =>
6873
ProcessBuilder(
69-
"scala-cli",
74+
if isWindows then "scala-cli.bat" else "scala-cli",
7075
scalaCliArgs
7176
).withWorkingDirectory(workDir)
7277
.spawn[IO]
@@ -135,7 +140,7 @@ def buildRunnerMill(
135140
) ++ extraBuildArgs
136141
// TODO pipe this to stdout so that we can see linker progress / errors.
137142
val builder = ProcessBuilder(
138-
"mill",
143+
if isWindows then "mill.bat" else "mill",
139144
millargs
140145
).withWorkingDirectory(workDir)
141146
.spawn[IO]

0 commit comments

Comments
 (0)