Skip to content

Suggest brew upgrade gh when new version detected#2929

Merged
mislav merged 1 commit intotrunkfrom
brew-upgrade-suggestion
Feb 9, 2021
Merged

Suggest brew upgrade gh when new version detected#2929
mislav merged 1 commit intotrunkfrom
brew-upgrade-suggestion

Conversation

@mislav
Copy link
Contributor

@mislav mislav commented Feb 8, 2021

When the update notifier is enabled and a new version was detected, show a Homebrew upgrade notice if:

  • the release was at least 24 hours ago; and
  • the current gh binary is under the Homebrew prefix.

Screen Shot 2021-02-08 at 13 56 41

Followup TODO:

  • Submit a PR to homebrew-core to enable our update notifier

Fixes #2855, ref. #166

When the update notifier is enabled and a new version was detected, show
a Homebrew upgrade notice if:
- the release was at least 24 hours ago; and
- the current `gh` binary is under the Homebrew prefix.
@mislav mislav requested a review from a team February 8, 2021 13:06
Copy link
Contributor

@samcoe samcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me 👍

return false
}

brewBinPrefix := filepath.Join(strings.TrimSpace(string(brewPrefixBytes)), "bin") + string(filepath.Separator)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL filepath.Separator exists.

@mislav mislav merged commit 5af2dca into trunk Feb 9, 2021
@mislav mislav deleted the brew-upgrade-suggestion branch February 9, 2021 17:39
mislav added a commit to mislav/homebrew-core that referenced this pull request Feb 10, 2021
BrewTestBot pushed a commit to Homebrew/homebrew-core that referenced this pull request Feb 10, 2021
Ref. cli/cli#2929

Closes #70784.

Signed-off-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show upgrade notifier for people who have installed gh via homebrew

2 participants