Skip to content

Commit

Permalink
Merge pull request #359 from civo:hotfix/version_check
Browse files Browse the repository at this point in the history
Refactor version check logic in common.go
  • Loading branch information
alejandrojnm authored Jan 4, 2024
2 parents 68c96b8 + c75d7ea commit a7e533d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@ func GithubClient() *github.Client {
func CheckVersionUpdate() {
ghClient := GithubClient()
res, skip := VersionCheck(ghClient)
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)

// 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)
}
}
}
}
Expand Down

0 comments on commit a7e533d

Please sign in to comment.