Skip to content

Commit

Permalink
Refactor version check logic in common.go
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro J. Nuñez Madrazo <[email protected]>
  • Loading branch information
alejandrojnm committed Jan 4, 2024
1 parent 68c96b8 commit c75d7ea
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 c75d7ea

Please sign in to comment.