mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Update beta version number logic
Previously it would just take the latest release and make the beta count based on the commits. Now if there is a previous beta version tag, its however many commits were made since the last beta tag
This commit is contained in:
parent
1293adf624
commit
e0be6e57b1
1 changed files with 8 additions and 2 deletions
|
@ -12,8 +12,14 @@ fun Project.getCommitCount(): String {
|
|||
}
|
||||
|
||||
fun Project.getCommitCountSinceLastRelease(): String {
|
||||
val lastTag = runCommand("git describe --tags --abbrev=0")
|
||||
return runCommand("git rev-list --count $lastTag..HEAD").toIntOrNull()?.toString() ?: "1"
|
||||
val betaTags = runCommand("git tag -l --sort=refname v${AndroidVersions.versionName}-b*")
|
||||
return if (betaTags.isNotEmpty()) {
|
||||
val betaTag = betaTags.split("\n").last()
|
||||
runCommand("git rev-list --count $betaTag..HEAD").toIntOrNull()?.toString() ?: "1"
|
||||
} else {
|
||||
val lastTag = runCommand("git describe --tags --abbrev=0")
|
||||
runCommand("git rev-list --count $lastTag..HEAD").toIntOrNull()?.toString() ?: "1"
|
||||
}
|
||||
// return "1"
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue