MCPcopy Create free account
hub / github.com/jetify-com/devbox / selfUpdateDevbox

Function selfUpdateDevbox

internal/vercheck/vercheck.go:149–164  ·  view source on GitHub ↗

selfUpdateDevbox will update the devbox CLI binary to the latest version.

(stdErr io.Writer)

Source from the content-addressed store, hash-verified

147
148// selfUpdateDevbox will update the devbox CLI binary to the latest version.
149func selfUpdateDevbox(stdErr io.Writer) error {
150 // Delete current version file. This will trigger an update when the next devbox command is run;
151 // in this case, inside triggerUpdate function.
152 if err := removeCurrentVersionFile(); err != nil {
153 return err
154 }
155
156 updated, err := triggerUpdate(stdErr)
157 if err != nil {
158 return errors.WithStack(err)
159 }
160
161 printSuccessMessage(stdErr, "Devbox", currentDevboxVersion, updated.devboxVersion)
162
163 return nil
164}
165
166type updatedVersions struct {
167 devboxVersion string

Callers 1

SelfUpdateFunction · 0.85

Calls 3

removeCurrentVersionFileFunction · 0.85
triggerUpdateFunction · 0.85
printSuccessMessageFunction · 0.85

Tested by

no test coverage detected