mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Android version tagger: Fix the case where we don't have three parts.
This commit is contained in:
@@ -36,10 +36,15 @@ val isDirty = providers.git("status", "--porcelain")
|
||||
.lineSequence()
|
||||
.any { it.isNotBlank() && !it.startsWith("??") } // untrackedIsDirty = false
|
||||
|
||||
val (major, minor, patch) = gitTag
|
||||
val versionParts = gitTag
|
||||
.removePrefix("v")
|
||||
.split(".")
|
||||
.map { it.toInt() }
|
||||
.mapNotNull { it.toIntOrNull() }
|
||||
|
||||
// Ensure we have at least 3 components by padding with 0
|
||||
val major = versionParts.getOrElse(0) { 0 }
|
||||
val minor = versionParts.getOrElse(1) { 0 }
|
||||
val patch = versionParts.getOrElse(2) { 0 }
|
||||
|
||||
val gitVersionName = buildString {
|
||||
append(gitTag)
|
||||
|
||||
Reference in New Issue
Block a user