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

Function removeCurrentVersionFile

internal/vercheck/vercheck.go:270–286  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

268}
269
270func removeCurrentVersionFile() error {
271 // currentVersionFilePath is the path to the file that contains the cached
272 // version. The launcher checks this file to see if a new version is available.
273 // If the version is newer, then the launcher updates.
274 //
275 // Note: keep this in sync with launch.sh code
276 currentVersionFilePath := filepath.Join(xdg.CacheSubpath("devbox"), "current-version")
277
278 if err := os.Remove(currentVersionFilePath); err != nil && !errors.Is(err, fs.ErrNotExist) {
279 return usererr.WithLoggedUserMessage(
280 err,
281 "Failed to delete version-cache at %s. Please manually delete it and try again.",
282 currentVersionFilePath,
283 )
284 }
285 return nil
286}
287
288func SemverCompare(ver1, ver2 string) int {
289 if !strings.HasPrefix(ver1, "v") {

Callers 2

selfUpdateLauncherFunction · 0.85
selfUpdateDevboxFunction · 0.85

Calls 4

CacheSubpathFunction · 0.92
WithLoggedUserMessageFunction · 0.92
IsMethod · 0.80
RemoveMethod · 0.45

Tested by

no test coverage detected