From 49b7528fca04e82155f0836af14a4c401ffee979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Sm=C3=B3=C5=82ka?= Date: Fri, 23 Feb 2024 18:09:30 +0100 Subject: [PATCH] Fix version comparison --- internal/update.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/update.go b/internal/update.go index 8ece012..c479bd4 100644 --- a/internal/update.go +++ b/internal/update.go @@ -8,6 +8,7 @@ import ( "net/http" "os" "path" + "strings" "time" ) @@ -54,7 +55,9 @@ func CheckForUpdate(currentVersion string) { return } - if release.TagName != currentVersion { + latestVersion := strings.TrimLeft(release.TagName, "v") + + if latestVersion != currentVersion { c := color.New(color.FgHiYellow) _, _ = c.Printf("A new version is available: %s (current: %s)\n", release.TagName, currentVersion) _, _ = c.Printf("Visit %v to update\n", repoURL)