fix(autoversion): do not crash on single tag
This commit is contained in:
parent
5583d335d1
commit
04f130951e
@ -10,7 +10,7 @@ fun List<Tag>.filter(): Pair<Tag, Tag?>? {
|
|||||||
val envName = System.getenv("CI_COMMIT_TAG")?.ifEmpty { null }
|
val envName = System.getenv("CI_COMMIT_TAG")?.ifEmpty { null }
|
||||||
val current = envName?.let { v -> indexOfFirst { it.name == v } } ?: 0
|
val current = envName?.let { v -> indexOfFirst { it.name == v } } ?: 0
|
||||||
if (current == -1) throw IllegalStateException("Current tag ($envName) not found in tag list")
|
if (current == -1) throw IllegalStateException("Current tag ($envName) not found in tag list")
|
||||||
if (size == current) return get(current) to null
|
if (size == current + 1) return get(current) to null
|
||||||
|
|
||||||
val ver = SemanticVersion.tryParse(get(current).name)
|
val ver = SemanticVersion.tryParse(get(current).name)
|
||||||
// special case: some mod projects use the format 1.0.0+forge to classify builds for different loaders
|
// special case: some mod projects use the format 1.0.0+forge to classify builds for different loaders
|
||||||
|
Loading…
Reference in New Issue
Block a user