MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / CheckVersionOnStartup

Function CheckVersionOnStartup

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

CheckVersionOnStartup performs a non-blocking version check and prints a message if an update is available. This is called on startup for interactive CLI commands.

(version string)

Source from the content-addressed store, hash-verified

46// CheckVersionOnStartup performs a non-blocking version check and prints a message if an update is available.
47// This is called on startup for interactive CLI commands.
48func CheckVersionOnStartup(version string) {
49 go func() {
50 result, err := update.CheckForUpdate(version, update.Options{})
51 if err != nil {
52 // Silently fail — version check is best-effort
53 return
54 }
55 if result.UpdateAvailable {
56 fmt.Printf("Chief v%s available (you have v%s). Run 'chief update' to upgrade.\n",
57 result.LatestVersion, result.CurrentVersion)
58 }
59 }()
60}
61
62// CheckVersionForServe performs a version check and returns the result for use by the serve command.
63func CheckVersionForServe(version, releasesURL string) *update.CheckResult {

Callers 1

mainFunction · 0.92

Calls 1

CheckForUpdateFunction · 0.92

Tested by

no test coverage detected