[intellij sh] IDEA-344658 Fix notification with a suggestion to update to the same version

GitOrigin-RevId: 74c22be9017c90b4e0b643a29f03794620776412
This commit is contained in:
Mikhail Mazurkevich
2024-03-20 22:03:07 +00:00
committed by intellij-monorepo-bot
parent 68d74c8f7a
commit 77ef2d9094
3 changed files with 6 additions and 2 deletions
@@ -80,6 +80,10 @@ public final class SemVer implements Comparable<SemVer> {
return compareTo(version) >= 0;
}
public boolean isGreaterThan(@NotNull SemVer version) {
return compareTo(version) > 0;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
@@ -246,7 +246,7 @@ public final class ShShfmtFormatterUtil {
return Pair.create(current, updateVersion);
}
SemVer currentVersion = SemVer.parseFromText(current);
if (currentVersion == null || updateVersionVer.isGreaterOrEqualThan(currentVersion)) {
if (currentVersion == null || updateVersionVer.isGreaterThan(currentVersion)) {
return Pair.create(current, updateVersion);
}
return null;
@@ -254,7 +254,7 @@ public final class ShShellcheckUtil {
return Pair.create(current, updateVersion);
}
SemVer currentVersion = SemVer.parseFromText(current);
if (currentVersion == null || updateVersionVer.isGreaterOrEqualThan(currentVersion)) {
if (currentVersion == null || updateVersionVer.isGreaterThan(currentVersion)) {
return Pair.create(current, updateVersion);
}
return null;