Improve message since sbtVersion may vary for different projects

This commit is contained in:
exoego 2019-07-19 08:32:41 +09:00
parent 88976ad23f
commit c57c950e92
2 changed files with 11 additions and 1 deletions

View File

@ -79,4 +79,14 @@ object SbtRunnerTest extends SimpleTestSuite with PowerAssertions {
()
}
test("sbt -V|-version should print sbtVersion") {
val out = sbtProcessWithOpts("-version", "", "").!!.trim
val expectedVersion = "^sbt version in this project: \\d\\.\\d+\\.\\d+\\S*$"
assert(out.matches(expectedVersion))
val out2 = sbtProcessWithOpts("-V", "", "").!!.trim
assert(out2.matches(expectedVersion))
()
}
}

View File

@ -378,7 +378,7 @@ run() {
if [[ $print_sbt_version ]]; then
# print sbtVersion
execRunner "$java_cmd" -jar "$sbt_jar" "sbtVersion" | tail -1
execRunner "$java_cmd" -jar "$sbt_jar" "sbtVersion" | tail -1 | sed -e 's/\[info\]/sbt version in this project:/g'
else
# run sbt
execRunner "$java_cmd" \