mirror of https://github.com/sbt/sbt.git
Introduce suppressSbtShellNotification
This requires moving the notification to after LoadProject, so much later in time, sadly.. Refs #3091
This commit is contained in:
parent
a6af8c50c8
commit
1c1be9a597
|
|
@ -64,6 +64,7 @@ object Keys {
|
|||
val shellPrompt = SettingKey(BasicKeys.shellPrompt)
|
||||
val analysis = AttributeKey[inc.Analysis]("analysis", "Analysis of compilation, including dependencies and generated outputs.", DSetting)
|
||||
val watch = SettingKey(BasicKeys.watch)
|
||||
val suppressSbtShellNotification = SettingKey[Boolean]("suppressSbtShellNotification", """True to suppress the "Executing in batch mode.." message.""", CSetting)
|
||||
val pollInterval = SettingKey[Int]("poll-interval", "Interval between checks for modified sources by the continuous execution command.", BMinusSetting)
|
||||
val watchSources = TaskKey[Seq[File]]("watch-sources", "Defines the sources in this project for continuous execution to watch for changes.", BMinusSetting)
|
||||
val watchTransitiveSources = TaskKey[Seq[File]]("watch-transitive-sources", "Defines the sources in all projects for continuous execution to watch.", CSetting)
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ object BuiltinCommands {
|
|||
ifLast, multi, shell, continuous, eval, alias, append, last, lastGrep, export, boot, nop, call, exit, early, initialize, act) ++
|
||||
compatCommands
|
||||
def DefaultBootCommands: Seq[String] =
|
||||
WriteSbtVersion :: NotifyUsersAboutShell :: LoadProject :: s"$IfLast $Shell" :: Nil
|
||||
WriteSbtVersion :: LoadProject :: NotifyUsersAboutShell :: s"$IfLast $Shell" :: Nil
|
||||
|
||||
def boot = Command.make(BootCommand)(bootParser)
|
||||
|
||||
|
|
@ -576,9 +576,11 @@ object BuiltinCommands {
|
|||
(state.remainingCommands contains Shell) ||
|
||||
(state.remainingCommands.lastOption exists (_ == s"$IfLast $Shell"))
|
||||
|
||||
private def notifyUsersAboutShell(state: State) =
|
||||
if (isInteractive && !intendsToInvokeShell(state) && !intendsToInvokeNew(state))
|
||||
private def notifyUsersAboutShell(state: State): Unit = {
|
||||
val suppress = Project extract state getOpt Keys.suppressSbtShellNotification getOrElse false
|
||||
if (!suppress && isInteractive && !intendsToInvokeShell(state) && !intendsToInvokeNew(state))
|
||||
state.log info "Executing in batch mode. For better performance use sbt's shell; hit [ENTER] to do so now"
|
||||
}
|
||||
|
||||
private def NotifyUsersAboutShell = "notify-users-about-shell"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue