MCPcopy Index your code
hub / github.com/jetify-com/devbox / Main

Function Main

internal/boxcli/root.go:116–137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114}
115
116func Main() {
117 timer := debug.Timer(strings.Join(os.Args, " "))
118 setSystemBinaryPaths()
119 ctx := context.Background()
120
121 if len(os.Args) > 1 && os.Args[1] == "upload-telemetry" {
122 // This subcommand is hidden and only run by devbox itself as a
123 // child process. We need to really make sure that we always
124 // exit and don't leave orphaned processes laying around.
125 time.AfterFunc(5*time.Second, func() {
126 os.Exit(0)
127 })
128 telemetry.Upload()
129 return
130 }
131
132 code := Execute(ctx, os.Args[1:])
133 // Run out here instead of as a middleware so we can capture any time we spend
134 // in middlewares as well.
135 timer.End()
136 os.Exit(code)
137}
138
139func listAllCommands(cmd *cobra.Command, indent string) {
140 // Print this command's name and description in table format with indentation

Callers 1

mainFunction · 0.92

Calls 5

TimerFunction · 0.92
UploadFunction · 0.92
setSystemBinaryPathsFunction · 0.85
ExecuteFunction · 0.85
EndMethod · 0.80

Tested by

no test coverage detected