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) val skipFile = skipWelcomeFile(state, version)
Files.createDirectories(skipFile.getParent) Files.createDirectories(skipFile.getParent)
val suppress = !SysProp.banner || Files.exists(skipFile) 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 */ } } catch { case _: IOException => /* Don't let errors in this command prevent startup */ }
state.put(bannerHasBeenShown, true) state.put(bannerHasBeenShown, true)
} else state } else state

View File

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