mirror of https://github.com/sbt/sbt.git
Notify users about shell only if compile is present
This is a change in strategy. The motivation is the need to find a good balance between: + informing the uninformed that would benefit from this information, & + not spamming the already informed Making it dependent on "compile" being present in remainingCommands will probably make it trigger for, for example, Maven users who are used to running "mvn compile" and always run "sbt compile", and who therefore are unneccesarily suffering terribly slow compile speeds by starting up the jvm and sbt every time. Fixes #3091
This commit is contained in:
parent
1c1be9a597
commit
54055835be
|
|
@ -572,13 +572,11 @@ object BuiltinCommands {
|
|||
|
||||
private def isInteractive = System.console() != null
|
||||
|
||||
private def intendsToInvokeShell(state: State) =
|
||||
(state.remainingCommands contains Shell) ||
|
||||
(state.remainingCommands.lastOption exists (_ == s"$IfLast $Shell"))
|
||||
private def intendsToInvokeCompile(state: State) = state.remainingCommands contains Keys.compile.key.label
|
||||
|
||||
private def notifyUsersAboutShell(state: State): Unit = {
|
||||
val suppress = Project extract state getOpt Keys.suppressSbtShellNotification getOrElse false
|
||||
if (!suppress && isInteractive && !intendsToInvokeShell(state) && !intendsToInvokeNew(state))
|
||||
if (!suppress && isInteractive && intendsToInvokeCompile(state))
|
||||
state.log info "Executing in batch mode. For better performance use sbt's shell; hit [ENTER] to do so now"
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue