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:
parent
fa536990e6
commit
78b67fabdd
2 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue