Separate logic for checking updates

During discussion in cli/cli#9934, we can to the conclusion that the logic around checking for core GitHub CLI updates would diverge from GitHub CLI
extension updates over time.  To that end, this commit splits that logic into a separate function with a new environment variable.
This commit is contained in:
Andy Feller 2025-01-10 14:16:46 -05:00
parent 1c32c986ec
commit 20062233c8
4 changed files with 79 additions and 6 deletions

View file

@ -77,7 +77,7 @@ func NewCmdExtension(io *iostreams.IOStreams, em extensions.ExtensionManager, ex
}
func checkForExtensionUpdate(em extensions.ExtensionManager, ext extensions.Extension) (*update.ReleaseInfo, error) {
if !update.ShouldCheckForUpdate() {
if !update.ShouldCheckForExtensionUpdate() {
return nil, nil
}

View file

@ -86,8 +86,12 @@ var HelpTopics = []helpTopic{
available in the viewport. When the value is a percentage, it will be applied against
the number of columns available in the current viewport.
%[1]sGH_NO_UPDATE_NOTIFIER%[1]s: set to any value to disable update notifications. By default, gh
checks for new releases once every 24 hours and displays an upgrade notice on standard
%[1]sGH_NO_UPDATE_NOTIFIER%[1]s: set to any value to disable GitHub CLI update notifications.
By default, gh checks for new releases once every 24 hours and displays an upgrade notice on standard
error if a newer version was found.
%[1]sGH_NO_EXTENSION_UPDATE_NOTIFIER%[1]s: set to any value to disable GitHub CLI extension update notifications.
By default, gh checks for new releases once every 24 hours and displays an upgrade notice on standard
error if a newer version was found.
%[1]sGH_CONFIG_DIR%[1]s: the directory where gh will store configuration files. If not specified,