From 4fb671d8ec1e6e3f02e9441c80764d73879d5d1f Mon Sep 17 00:00:00 2001 From: Nolij Date: Tue, 20 Aug 2024 18:04:06 -0400 Subject: [PATCH] fix auto-versioning bug --- build.gradle.kts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8b92a0d..94e2ded 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -117,7 +117,8 @@ if (releaseChannel.suffix != null) { patchAndSuffix += "." val maxBuild = patchHistory - .mapNotNull { it.removePrefix(patchAndSuffix).toIntOrNull() } + .filter { it.startsWith(patchAndSuffix) } + .mapNotNull { it.substring(patchAndSuffix.length).toIntOrNull() } .maxOrNull() val build = (maxBuild?.plus(releaseIncrement)) ?: 1