Skip to content

Commit a9f8c1a

Browse files
committed
Don't show update proposal for snapshot version if there is no release for that snapshot
1 parent 07210de commit a9f8c1a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/java/com/github/introfog/gitwave/model/UpdateChecker.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,14 @@ private UpdateChecker() {
3838
public static boolean isNewReleaseAvailable() {
3939
final String latestTag = fetchLatestTag(AppConstants.GIT_HUB_REPO_OWNER, AppConstants.APP_NAME);
4040
LOGGER.info("Fetch '{}' tag from GitHub repo.", latestTag);
41-
return latestTag != null && !AppConstants.VERSION.equals(latestTag);
41+
if (latestTag == null) {
42+
return false;
43+
}
44+
if (AppConstants.VERSION.contains("SNAPSHOT") && !AppConstants.VERSION.replace("-SNAPSHOT", "").equals(latestTag)) {
45+
LOGGER.info("Current app version is " + AppConstants.VERSION + ", new release check will be skipped.");
46+
return false;
47+
}
48+
return !AppConstants.VERSION.equals(latestTag);
4249
}
4350

4451
public static String fetchLatestTag(String owner, String repo) {

0 commit comments

Comments
 (0)