Merge branch '1.9.x' into wip/merge-1.9.x

This commit is contained in:
Eugene Yokota
2022-12-31 16:28:47 -05:00
52 changed files with 222 additions and 66 deletions
@@ -63,8 +63,10 @@ object BuildServerConnection {
// For those who use an old sbt script, the -Dsbt.script is not set
// As a fallback we try to find the sbt script in $PATH
val fileName = if (Properties.isWin) "sbt.bat" else "sbt"
val envPath = sys.env.getOrElse("PATH", "")
val allPaths = envPath.split(File.pathSeparator).map(Paths.get(_))
val envPath = sys.env.collectFirst {
case (k, v) if k.toUpperCase() == "PATH" => v
}
val allPaths = envPath.map(_.split(File.pathSeparator).map(Paths.get(_))).getOrElse(Array.empty)
allPaths
.map(_.resolve(fileName))
.find(file => Files.exists(file) && Files.isExecutable(file))