版本号处理

This commit is contained in:
大米 2024-08-30 17:14:10 +08:00
parent 6f4e2a22ac
commit 4bc3d6c99b
1 changed files with 4 additions and 1 deletions

View File

@ -135,7 +135,7 @@ public class VersionUtil {
char lastChar = version.charAt(version.length() - 1);
boolean isLetter = Character.isLetter(lastChar);
if (!isLetter) {
return version + "a";
return version + ".a";
} else {
int lastCharIndex = version.length() - 1;
char newLastChar = (char) (lastChar + 1);
@ -143,6 +143,9 @@ public class VersionUtil {
if (newLastChar > 'z') {
// Handle case where the last character is 'z'
StringBuilder sb = new StringBuilder(version.substring(0, lastCharIndex));
if(!sb.toString().contains(".")) {
sb.append(".");
}
sb.append("a").append('a');
return sb.toString();
} else {