0
0
mirror of https://git.tardis.systems/mirrors/yuzu.git synced 2025-01-03 03:54:45 +00:00

android: Fix regex for git version

This commit is contained in:
t895 2024-02-08 14:24:15 -05:00
parent f049453dd6
commit 0a1283f94f

View File

@ -259,13 +259,20 @@ fun runGitCommand(command: List<String>): String {
}
fun getGitVersion(): String {
val gitVersion = runGitCommand(listOf("git", "describe", "--always", "--long"))
val gitVersion = runGitCommand(
listOf(
"git",
"describe",
"--always",
"--long"
)
).replace(Regex("(-0)?-[^-]+$"), "")
val versionName = if (System.getenv("GITHUB_ACTIONS") != null) {
System.getenv("GIT_TAG_NAME") ?: gitVersion
} else {
gitVersion
}
return versionName.replace(Regex("(-0)?-[^-]+$"), "").ifEmpty { "0.0" }
return versionName.ifEmpty { "0.0" }
}
fun getGitHash(): String =