1. Added GH_NO_UPDATE_NOTIFIER to hhelp_topics

2. Updated test to check if passed variable is not empty
This commit is contained in:
ShubhankarKG 2020-10-08 21:22:26 +05:30
parent fa536990e6
commit 78b67fabdd
2 changed files with 3 additions and 1 deletions

View file

@ -187,7 +187,7 @@ func printError(out io.Writer, err error, cmd *cobra.Command, debug bool) {
func shouldCheckForUpdate() bool {
isCIEnvironment := (os.Getenv("CI") != "") || (os.Getenv("BUILD_NUMBER") != "") || (os.Getenv("RUN_ID") != "")
isGlobalDisabled := os.Getenv("GH_NO_UPDATE_NOTIFIER") == "disabled"
isGlobalDisabled := os.Getenv("GH_NO_UPDATE_NOTIFIER") != ""
return updaterEnabled != "" && !isCompletionCommand() && utils.IsTerminal(os.Stderr) && !isCIEnvironment && !isGlobalDisabled
}

View file

@ -39,6 +39,8 @@ func NewHelpTopic(topic string) *cobra.Command {
CLICOLOR_FORCE: set to a value other than "0" to keep ANSI colors in output
even when the output is piped.
GH_NO_UPDATE_NOTIFIER: set to "1" to disable checking for updates.
`)
cmd := &cobra.Command{