From bc9b22d3360f602332a68918021e6edee88094ad Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Wed, 20 Nov 2019 11:18:45 -0800 Subject: [PATCH] Alert if there is a new version Co-Authored-By: Josh Abernathy --- command/checkUpdate.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/command/checkUpdate.go b/command/checkUpdate.go index f0afe9175..90c30e24c 100644 --- a/command/checkUpdate.go +++ b/command/checkUpdate.go @@ -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 }