Skip to content

Commit

Permalink
fix: resolve plugin crash when using nightly biome releases (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
walkerdb authored Dec 22, 2024
1 parent 4b695b7 commit 1c7850e
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,11 @@ class BiomePackage(private val project: Project) {

fun compareVersion(version1: String,
version2: String): Int {
val parts1 = version1.split(".").map { it.toInt() }
val parts2 = version2.split(".").map { it.toInt() }
// standardize nightly versions like 1.9.5-nightly.81fdedb to 1.9.5
val cleanVersion1 = version1.split("-").first()
val cleanVersion2 = version2.split("-").first()
val parts1 = cleanVersion1.split(".").map { it.toInt() }
val parts2 = cleanVersion2.split(".").map { it.toInt() }

val maxLength = maxOf(parts1.size, parts2.size)

Expand Down

0 comments on commit 1c7850e

Please sign in to comment.