mirror of
https://github.com/sbt/sbt.git
synced 2026-09-07 19:05:53 +02:00
Merge branch '1.9.x' into wip/merge-1.9.x
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user