Ignore "-SNAPSHOT" in snapshot build versions

This commit is contained in:
libraryaddict 2019-03-05 17:47:21 +13:00
parent 94f8371772
commit ae9419d234

View File

@ -108,9 +108,9 @@ public class UpdateChecker {
}
private boolean isNewerVersion(String currentVersion, String newVersion) {
// Remove 'v' from string, split by decimal points
String[] cSplit = currentVersion.replace("v", "").split("\\.");
String[] nSplit = newVersion.replace("v", "").split("\\.");
// Remove 'v' and '-SNAPSHOT' from string, split by decimal points
String[] cSplit = currentVersion.replaceAll("(v)|(-SNAPSHOT)", "").split("\\.");
String[] nSplit = newVersion.replaceAll("(v)|(-SNAPSHOT)", "").split("\\.");
// Iterate over the versions from left to right
for (int i = 0; i < Math.max(cSplit.length, nSplit.length); i++) {