Skip to content

Commit

Permalink
Merge pull request #12 from ThreeDotsLabs/fix
Browse files Browse the repository at this point in the history
Fix version comparison
  • Loading branch information
m110 committed Feb 23, 2024
2 parents 8431db1 + 49b7528 commit 31211a8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/update.go
Expand Up @@ -8,6 +8,7 @@ import (
"net/http"
"os"
"path"
"strings"
"time"
)

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 31211a8

Please sign in to comment.