Skip to content

Commit

Permalink
Merge pull request #364 from civo/versionCheckFix
Browse files Browse the repository at this point in the history
Respect version skip correctly in CheckVersionUpdate
  • Loading branch information
vishalanarase authored Feb 5, 2024
2 parents 5d91a20 + ae86d91 commit e5855d6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ func GithubClient() *github.Client {
func CheckVersionUpdate() {
ghClient := GithubClient()
res, skip := VersionCheck(ghClient)
if skip {
return
}

// Check if the version is different from the one in the binary
if res.TagName != nil && *res.TagName != fmt.Sprintf("v%s", VersionCli) {
if !skip {
if res.TagName != nil && *res.TagName != VersionCli {
fmt.Printf("A newer version (%s) is available, please upgrade with \"civo update\"\n", *res.TagName)
}
if res.TagName != nil && *res.TagName != VersionCli {
fmt.Printf("A newer version (%s) is available, please upgrade with \"civo update\"\n", *res.TagName)
}
}
}
Expand All @@ -63,6 +64,6 @@ func VersionCheck(client *github.Client) (res *github.RepositoryRelease, skip bo
}
if err != nil {
return nil, true
}
}
return release, false
}

0 comments on commit e5855d6

Please sign in to comment.