MCPcopy Index your code
hub / github.com/cli/cli / ShouldCheckForUpdate

Function ShouldCheckForUpdate

internal/update/update.go:80–88  ·  view source on GitHub ↗

ShouldCheckForUpdate decides whether we check for updates for the GitHub CLI based on user preferences and current execution context.

()

Source from the content-addressed store, hash-verified

78
79// ShouldCheckForUpdate decides whether we check for updates for the GitHub CLI based on user preferences and current execution context.
80func ShouldCheckForUpdate() bool {
81 if os.Getenv("GH_NO_UPDATE_NOTIFIER") != "" {
82 return false
83 }
84 if os.Getenv("CODESPACES") != "" {
85 return false
86 }
87 return !ci.IsCI() && IsTerminal(os.Stdout) && IsTerminal(os.Stderr)
88}
89
90// CheckForUpdate checks whether an update exists for the GitHub CLI based on recency of last check within past 24 hours.
91func CheckForUpdate(ctx context.Context, client *http.Client, stateFilePath, repo, currentVersion string) (*ReleaseInfo, error) {

Callers 2

checkForUpdateFunction · 0.92
TestShouldCheckForUpdateFunction · 0.85

Calls 2

IsCIFunction · 0.92
IsTerminalFunction · 0.85

Tested by 1

TestShouldCheckForUpdateFunction · 0.68