Skip to content

Commit

Permalink
fix: canary is not a release
Browse files Browse the repository at this point in the history
Fixes #240
  • Loading branch information
ThisAMJ committed Dec 2, 2024
1 parent 3b402fa commit daa8ec5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Features/Updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ static bool isNewerVersion(std::string& verStr) {
auto version = getVersionComponents(verStr.c_str());
auto current = getVersionComponents(SAR_VERSION);

if ((version && version->canary) || (current && current->canary)) {
if ((version && version->canary) && (current && current->canary)) {
// For update from canary to canary, we just check if it's a different version
return strcmp(SAR_VERSION, verStr.c_str()) != 0;
}

if (!current) {
if (!current || current->canary) {
// Otherwise, canary versions shouldn't downgrade to releases
THREAD_PRINT("Cannot compare version numbers on non-release version\n");
return false;
}
Expand Down Expand Up @@ -389,7 +391,7 @@ CON_COMMAND(sar_check_update, "sar_check_update [release|pre|canary] - check whe

if (!strcmp(args[1], "pre")) {
channel = Channel::PreRelease;
} else if (!strcmp(args[1], "pre")) {
} else if (!strcmp(args[1], "canary")) {
channel = Channel::Canary;
}

Expand Down

0 comments on commit daa8ec5

Please sign in to comment.