refactor: Simplify beta version format

This commit is contained in:
Ahmad Ansori Palembani 2024-08-02 07:05:40 +07:00
parent 93709836e7
commit 4a8cf8d24d
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6

View file

@ -35,12 +35,12 @@ val _versionName = "1.8.5"
val betaCount by lazy { val betaCount by lazy {
val betaTags = runCommand("git tag -l --sort=refname v${_versionName}-b*") val betaTags = runCommand("git tag -l --sort=refname v${_versionName}-b*")
String.format("%02d", if (betaTags.isNotEmpty()) { if (betaTags.isNotEmpty()) {
val betaTag = betaTags.split("\n").last().substringAfter("-b").toIntOrNull() val betaTag = betaTags.split("\n").last().substringAfter("-b").toIntOrNull()
((betaTag ?: 0) + 1) ((betaTag ?: 0) + 1)
} else { } else {
1 1
}) }.toString()
} }
val commitCount by lazy { runCommand("git rev-list --count HEAD") } val commitCount by lazy { runCommand("git rev-list --count HEAD") }
val commitHash by lazy { runCommand("git rev-parse --short HEAD") } val commitHash by lazy { runCommand("git rev-parse --short HEAD") }