Don't warn on server command

This commit is contained in:
Eugene Yokota 2017-04-04 20:00:56 -04:00
parent 7ffae0f7df
commit 15255c15b0
1 changed files with 4 additions and 3 deletions

View File

@ -73,13 +73,14 @@ object MainLoop {
// transferLevels(state, newLogging)
val loggedState = state.copy(globalLogging = newLogging)
def isInteractive = System.console() != null
def hasShell = state.remainingCommands contains "shell"
def hasCommand(cmd: String): Boolean =
(state.remainingCommands find { x => x.commandLine == cmd }).isDefined
/**
* 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) {
def endsWithBoot = state.remainingCommands.lastOption exists (_.commandLine == "boot")
if (isInteractive && !hasCommand("shell") && !hasCommand("server") && !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'"