From 15255c15b0315ee265b194ee7b8ba1ad54abdb93 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Tue, 4 Apr 2017 20:00:56 -0400 Subject: [PATCH] Don't warn on server command --- main/src/main/scala/sbt/MainLoop.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main/src/main/scala/sbt/MainLoop.scala b/main/src/main/scala/sbt/MainLoop.scala index a9b9edcf3..d4be1d232 100644 --- a/main/src/main/scala/sbt/MainLoop.scala +++ b/main/src/main/scala/sbt/MainLoop.scala @@ -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'"