Skip to content

Commit a701318

Browse files
authored
Merge pull request #1 from joomcode/fix-bazel-version-resolution
Fix bazel version resolution
2 parents 85b5a40 + f94d9a6 commit a701318

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module(
22
name = "bazel-diff",
3-
version = "13.1.1",
3+
version = "13.1.2",
44
compatibility_level = 0,
55
)
66

cli/src/main/kotlin/com/bazel_diff/bazel/BazelQueryService.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ class BazelQueryService(
5353
if (result.output.size != 1 || !result.output.first().startsWith("bazel ")) {
5454
throw RuntimeException("Bazel version command returned unexpected output: ${result.output}")
5555
}
56-
// Trim off any prerelease suffixes.
56+
// Trim off any prerelease suffixes (e.g., 8.6.0-rc1 or 8.6.0rc1).
5757
val versionString = result.output.first().removePrefix("bazel ").trim().split('-')[0]
58-
val version = versionString.split('.').map { it.toInt() }.toTypedArray()
58+
val version = versionString.split('.').map { it.takeWhile { c -> c.isDigit() }.toInt() }.toTypedArray()
5959
return Triple(version[0], version[1], version[2])
6060
}
6161

0 commit comments

Comments
 (0)