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

Function Execute

cmd/root.go:29–35  ·  view source on GitHub ↗

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

(currentVersion string)

Source from the content-addressed store, hash-verified

27// Execute adds all child commands to the root command and sets flags appropriately.
28// This is called by main.main(). It only needs to happen once to the rootCmd.
29func Execute(currentVersion string) error {
30 rootCmd.Version = currentVersion
31 info := version.FetchUpdateInfo(rootCmd.Version)
32 defer info.PromptUpdateIfAvailable()
33 ctx := version.WithContext(context.Background(), &info)
34 return rootCmd.ExecuteContext(ctx)
35}
36
37func init() {
38 cobra.OnInitialize(initConfig)

Callers 1

mainFunction · 0.92

Calls 3

FetchUpdateInfoFunction · 0.92
WithContextFunction · 0.92

Tested by

no test coverage detected