diff --git a/common/common.go b/common/common.go index 5d38d11d..744a5094 100644 --- a/common/common.go +++ b/common/common.go @@ -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) } } } @@ -63,6 +64,6 @@ func VersionCheck(client *github.Client) (res *github.RepositoryRelease, skip bo } if err != nil { return nil, true - } + } return release, false }