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

Function ShouldCheckForExtensionUpdate

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

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