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

Function ShouldCheckForExtensionUpdate

internal/update/update.go:41–49  ·  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

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