From e6ddfd66c5b1aa1331073cf4a5aff9c6059dbe03 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Sun, 19 Oct 2025 22:56:12 +0000 Subject: [PATCH] fix(update): normalize version strings for correct comparison The version check was comparing "4.0.8" (no prefix) with "v4.0.8" (with prefix), causing it to always think an update was available. Now both versions are normalized to have the "v" prefix before comparison, so "Already up to date!" works correctly. --- ts/cli/service-handler.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ts/cli/service-handler.ts b/ts/cli/service-handler.ts index 2ee52c7..725ef81 100644 --- a/ts/cli/service-handler.ts +++ b/ts/cli/service-handler.ts @@ -145,12 +145,16 @@ export class ServiceHandler { const release = JSON.parse(response); const latestVersion = release.tag_name; // e.g., "v4.0.7" - logger.dim(`Current version: ${currentVersion}`); - logger.dim(`Latest version: ${latestVersion}`); + // Normalize versions for comparison (ensure both have "v" prefix) + const normalizedCurrent = currentVersion.startsWith('v') ? currentVersion : `v${currentVersion}`; + const normalizedLatest = latestVersion.startsWith('v') ? latestVersion : `v${latestVersion}`; + + logger.dim(`Current version: ${normalizedCurrent}`); + logger.dim(`Latest version: ${normalizedLatest}`); console.log(''); - // Compare versions (both are in format "v4.0.7") - if (currentVersion === latestVersion) { + // Compare normalized versions + if (normalizedCurrent === normalizedLatest) { logger.success('Already up to date!'); console.log(''); return;