Update shouldCheckForUpdate
This commit is contained in:
parent
0d593e78aa
commit
3a22ab7eba
2 changed files with 8 additions and 4 deletions
|
|
@ -186,7 +186,9 @@ func printError(out io.Writer, err error, cmd *cobra.Command, debug bool) {
|
|||
}
|
||||
|
||||
func shouldCheckForUpdate() bool {
|
||||
return updaterEnabled != "" && !isCompletionCommand() && utils.IsTerminal(os.Stderr)
|
||||
isCIEnvironment := (os.Getenv("CI") != "") || (os.Getenv("BUILD_NUMBER") != "") || (os.Getenv("RUN_ID") != "")
|
||||
isGlobalDisabled := os.Getenv("GH_NO_UPDATE_NOTIFIER") == "disabled"
|
||||
return updaterEnabled != "" && !isCompletionCommand() && utils.IsTerminal(os.Stderr) && !isCIEnvironment && !isGlobalDisabled
|
||||
}
|
||||
|
||||
func isCompletionCommand() bool {
|
||||
|
|
|
|||
|
|
@ -11,9 +11,11 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
defaultGitProtocol = "https"
|
||||
PromptsDisabled = "disabled"
|
||||
PromptsEnabled = "enabled"
|
||||
defaultGitProtocol = "https"
|
||||
PromptsDisabled = "disabled"
|
||||
PromptsEnabled = "enabled"
|
||||
UpdateCheckEnabled = "enabled"
|
||||
UpdateCheckDisabled = "disabled"
|
||||
)
|
||||
|
||||
// This interface describes interacting with some persistent configuration for gh.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue