MCPcopy Create free account
hub / github.com/github/gh-aw / shouldRunCompileUpdateCheck

Function shouldRunCompileUpdateCheck

pkg/cli/compile_update_check.go:106–130  ·  view source on GitHub ↗
(noCheckUpdate bool)

Source from the content-addressed store, hash-verified

104}
105
106func shouldRunCompileUpdateCheck(noCheckUpdate bool) bool {
107 if noCheckUpdate {
108 compileUpdateCheckLog.Print("Update check disabled via --no-check-update flag")
109 return false
110 }
111 if os.Getenv(compileUpdateCheckDisableEnv) != "" {
112 compileUpdateCheckLog.Printf("Update check disabled via %s", compileUpdateCheckDisableEnv)
113 return false
114 }
115 if IsRunningInCI() {
116 compileUpdateCheckLog.Print("Update check disabled in CI environment")
117 return false
118 }
119 if isRunningAsMCPServer() {
120 compileUpdateCheckLog.Print("Update check disabled in MCP server mode")
121 return false
122 }
123 if !compileUpdateCheckIsTerminalFunc() {
124 compileUpdateCheckLog.Print("Update check disabled when stderr is not a terminal")
125 return false
126 }
127
128 lastCheckFile := getCompileUpdateCheckFilePath()
129 return shouldRunUpdateCheckAtPath(lastCheckFile, compileUpdateCheckInterval, "compile update check", compileUpdateCheckLog)
130}
131
132func waitForCompileUpdateNotification(ctx context.Context, results <-chan *compileUpdateNotification, timeout time.Duration) *compileUpdateNotification {
133 if results == nil {

Callers 2

StartCompileUpdateCheckFunction · 0.85

Calls 7

IsRunningInCIFunction · 0.85
isRunningAsMCPServerFunction · 0.85
PrintMethod · 0.80
GetenvMethod · 0.80
PrintfMethod · 0.45

Tested by 1