Skip to content

Commit

Permalink
Merge pull request #51 from eed3si9n/wip/standby
Browse files Browse the repository at this point in the history
Add sbt.launcher.standby
  • Loading branch information
dwijnand authored Apr 3, 2018
2 parents 83e50ca + f6f5e7b commit a4eeb60
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions launcher-implementation/src/main/scala/xsbt/boot/Boot.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import java.io.File
// The entry point to the launcher
object Boot {
def main(args: Array[String]) {
standBy()
val config = parseArgs(args)
// If we havne't exited, we set up some hooks and launch
System.clearProperty("scala.home") // avoid errors from mixing Scala versions in the same JVM
Expand All @@ -16,6 +17,20 @@ object Boot {
CheckProxy()
run(config)
}

def standBy(): Unit = {
import scala.concurrent.duration.Duration
sys.props.get("sbt.launcher.standby") foreach { s =>
val sec = Duration(s).toSeconds
if (sec >= 1) {
(sec to 1 by -1) foreach { i =>
println(s"[info] Standing by: $i")
Thread.sleep(1000)
}
}
}
}

def parseArgs(args: Array[String]): LauncherArguments = {
@annotation.tailrec
def parse(args: List[String], isLocate: Boolean, remaining: List[String]): LauncherArguments =
Expand Down

0 comments on commit a4eeb60

Please sign in to comment.