From daa8ec573ef214efc0110335d5318f22bd267aa5 Mon Sep 17 00:00:00 2001 From: AMJ <69196954+ThisAMJ@users.noreply.github.com> Date: Mon, 2 Dec 2024 16:26:14 +1100 Subject: [PATCH] fix: canary is not a release Fixes #240 --- src/Features/Updater.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Features/Updater.cpp b/src/Features/Updater.cpp index f83fdccc..a89f0ade 100644 --- a/src/Features/Updater.cpp +++ b/src/Features/Updater.cpp @@ -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; } @@ -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; }