Skip to content

Commit

Permalink
Actually fix the version check this time
Browse files Browse the repository at this point in the history
  • Loading branch information
iamrecursion committed May 14, 2021
1 parent 2e570f3 commit 98f1c89
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions project/EnvironmentCheck.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,17 @@ object EnvironmentCheck {
val cmd = "rustc --version"

try {
val versionStr = cmd.!!.trim.substring(6)
val versionStr = cmd.!!.trim

if (!versionStr.contains(expectedVersion))
val contained = versionStr.contains(expectedVersion)

if (!contained) {
log.error(
s"Rust version mismatch. $expectedVersion is expected, " +
s"but it seems $versionStr is installed."
)
versionStr == expectedVersion
}
contained
} catch {
case _ @(_: RuntimeException | _: IOException) =>
log.error("Rust version check failed. Make sure rustc is in your PATH.")
Expand Down

0 comments on commit 98f1c89

Please sign in to comment.