From ae9419d234ffc0a2577e93ea27dfa1e7a4dc5a7c Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Tue, 5 Mar 2019 17:47:21 +1300 Subject: [PATCH] Ignore "-SNAPSHOT" in snapshot build versions --- .../me/libraryaddict/disguise/utilities/UpdateChecker.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/UpdateChecker.java b/src/main/java/me/libraryaddict/disguise/utilities/UpdateChecker.java index 6f7399a5..799be435 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/UpdateChecker.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/UpdateChecker.java @@ -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++) {