We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 85b5a40 commit 4cad10dCopy full SHA for 4cad10d
1 file changed
cli/src/main/kotlin/com/bazel_diff/bazel/BazelQueryService.kt
@@ -53,9 +53,9 @@ class BazelQueryService(
53
if (result.output.size != 1 || !result.output.first().startsWith("bazel ")) {
54
throw RuntimeException("Bazel version command returned unexpected output: ${result.output}")
55
}
56
- // Trim off any prerelease suffixes.
+ // Trim off any prerelease suffixes (e.g., 8.6.0-rc1 or 8.6.0rc1).
57
val versionString = result.output.first().removePrefix("bazel ").trim().split('-')[0]
58
- val version = versionString.split('.').map { it.toInt() }.toTypedArray()
+ val version = versionString.split('.').map { it.takeWhile { c -> c.isDigit() }.toInt() }.toTypedArray()
59
return Triple(version[0], version[1], version[2])
60
61
0 commit comments