Alert if there is a new version
Co-Authored-By: Josh Abernathy <joshaber@gmail.com>
This commit is contained in:
parent
817b154705
commit
bc9b22d336
1 changed files with 8 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ import (
|
|||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/github/gh-cli/utils"
|
||||
"github.com/mattn/go-isatty"
|
||||
)
|
||||
|
||||
|
|
@ -20,7 +21,13 @@ func CheckForUpdate() error {
|
|||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("🌭 %+v %+v\n", latestVersion, Version)
|
||||
updateAvailable := latestVersion != Version
|
||||
if updateAvailable {
|
||||
fmt.Printf(utils.Cyan(`
|
||||
New version of gh is available! %s → %s
|
||||
Changelog: https://github.com/github/homebrew-gh/releases/tag/%[2]s
|
||||
Run 'brew upgrade github/gh/gh' to update!`)+"\n\n", Version, latestVersion)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue