MCPcopy Index your code
hub / github.com/bootdotdev/bootdev / checkVersionStatus

Function checkVersionStatus

cmd/status.go:48–64  ·  view source on GitHub ↗
(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

46}
47
48func checkVersionStatus(cmd *cobra.Command) {
49 info := version.FromContext(cmd.Context())
50 if info == nil || info.FailedToFetch != nil {
51 fmt.Println("Unable to check version status")
52 if info != nil && info.FailedToFetch != nil {
53 fmt.Printf("Error: %s\n", info.FailedToFetch.Error())
54 }
55 return
56 }
57
58 if info.IsOutdated {
59 fmt.Printf("CLI outdated: %s → %s available\n", info.CurrentVersion, info.LatestVersion)
60 fmt.Println("Run 'bootdev upgrade' to update")
61 } else {
62 fmt.Printf("CLI up to date (%s)\n", info.CurrentVersion)
63 }
64}
65
66func init() {
67 rootCmd.AddCommand(statusCmd)

Callers 1

status.goFile · 0.85

Calls 1

FromContextFunction · 0.92

Tested by

no test coverage detected