clear banner

This commit is contained in:
Eugene Yokota 2019-09-19 18:09:57 -04:00
parent 214ae747a8
commit 3be047d050
2 changed files with 17 additions and 11 deletions

View File

@ -1002,7 +1002,9 @@ object BuiltinCommands {
val skipFile = skipWelcomeFile(state, version)
Files.createDirectories(skipFile.getParent)
val suppress = !SysProp.banner || Files.exists(skipFile)
if (!suppress) state.log.info(Banner(version))
if (!suppress) {
Banner(version).foreach(banner => state.log.info(banner))
}
} catch { case _: IOException => /* Don't let errors in this command prevent startup */ }
state.put(bannerHasBeenShown, true)
} else state

View File

@ -8,14 +8,18 @@
package sbt.internal
private[sbt] object Banner {
def apply(version: String): String =
s"""
|Welcome to sbt $version.
|Here are some highlights of this release:
| - Coursier: new default library management using https://get-coursier.io
| - Super shell: displays actively running tasks
| - Turbo mode: makes `test` and `run` faster in interactive sessions. Try it by running `set ThisBuild / turbo := true`.
|See https://www.lightbend.com/blog/sbt-1.3.0-release for full release notes.
|Hide the banner for this release by running `skipBanner`.
|""".stripMargin.linesIterator.filter(_.nonEmpty).mkString("\n")
def apply(version: String): Option[String] =
version match {
case "1.3.0" =>
Some(s"""
|Welcome to sbt $version.
|Here are some highlights of this release:
| - Coursier: new default library management using https://get-coursier.io
| - Super shell: displays actively running tasks
| - Turbo mode: makes `test` and `run` faster in interactive sessions. Try it by running `set ThisBuild / turbo := true`.
|See https://www.lightbend.com/blog/sbt-1.3.0-release for full release notes.
|Hide the banner for this release by running `skipBanner`.
|""".stripMargin.linesIterator.filter(_.nonEmpty).mkString("\n"))
case _ => None
}
}