MCPcopy Create free account
hub / github.com/cli/cli / ShouldCheckForExtensionUpdate

Function ShouldCheckForExtensionUpdate

internal/update/update.go:40–48  ·  view source on GitHub ↗

ShouldCheckForExtensionUpdate decides whether we check for updates for GitHub CLI extensions based on user preferences and current execution context. During cli/cli#9934, this logic was split out from ShouldCheckForUpdate() because we envisioned it going in a different direction.

()

Source from the content-addressed store, hash-verified

38// ShouldCheckForExtensionUpdate decides whether we check for updates for GitHub CLI extensions based on user preferences and current execution context.
39// During cli/cli#9934, this logic was split out from ShouldCheckForUpdate() because we envisioned it going in a different direction.
40func ShouldCheckForExtensionUpdate() bool {
41 if os.Getenv("GH_NO_EXTENSION_UPDATE_NOTIFIER") != "" {
42 return false
43 }
44 if os.Getenv("CODESPACES") != "" {
45 return false
46 }
47 return !ci.IsCI() && IsTerminal(os.Stdout) && IsTerminal(os.Stderr)
48}
49
50// CheckForExtensionUpdate checks whether an update exists for a specific extension based on extension type and recency of last check within past 24 hours.
51func CheckForExtensionUpdate(em extensions.ExtensionManager, ext extensions.Extension, now time.Time) (*ReleaseInfo, error) {

Callers 2

checkForExtensionUpdateFunction · 0.92

Calls 2

IsCIFunction · 0.92
IsTerminalFunction · 0.85

Tested by 1