Skip to content

Commit

Permalink
Default to forking on Windows (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarchambault authored Feb 24, 2021
1 parent 088cfaa commit cfb4dd0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cli/src/main/scala/ammrunner/cli/Options.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ object Options {
implicit val parser = Parser[Options]
implicit val help = Help[Options]

private val defaultFork =
private def isWindows = System.getProperty("os.name")
.toLowerCase(java.util.Locale.ROOT)
.contains("windows")

// not sure why, the tests don't pass on Windows without forking
private val defaultFork = isWindows ||
// Starting from JDK 9, AppClassLoader gets in the way of isolating
// our JARs from those of Ammonite, so we fork by default.
scala.util.Try(System.getProperty("java.version").takeWhile(_ != '.').toInt)
Expand Down

0 comments on commit cfb4dd0

Please sign in to comment.