Merge pull request #3008 from dwijnand/fix/3004/false-positive-executing-in-batch-mode

Handle non-shell sbt startup warning
This commit is contained in:
eugene yokota 2017-03-13 10:02:26 -07:00 committed by GitHub
commit 4de2d5040b
1 changed files with 6 additions and 1 deletions

View File

@ -67,7 +67,12 @@ object MainLoop {
val loggedState = state.copy(globalLogging = newLogging)
def isInteractive = System.console() != null
def hasShell = state.remainingCommands contains "shell"
if (isInteractive && !hasShell) {
/**
* The "boot" command adds "iflast shell" ("if last shell")
* which basically means it falls back to shell if there are no further commands
*/
def endsWithBoot = state.remainingCommands.lastOption exists (_ == "boot")
if (isInteractive && !hasShell && !endsWithBoot) {
state.log warn "Executing in batch mode."
state.log warn " For better performance, hit [ENTER] to switch to interactive mode, or"
state.log warn " consider launching sbt without any commands, or explicitly passing 'shell'"