MCPcopy Create free account
hub / github.com/algolia/cli / checkForUpdate

Function checkForUpdate

pkg/cmd/root/root.go:399–406  ·  view source on GitHub ↗
(cfg config.Config, currentVersion string)

Source from the content-addressed store, hash-verified

397}
398
399func checkForUpdate(cfg config.Config, currentVersion string) (*update.ReleaseInfo, error) {
400 if !shouldCheckForUpdate() {
401 return nil, nil
402 }
403 stateFilePath := filepath.Join(cfg.GetConfigFolder(os.Getenv("XDG_CONFIG_HOME")), "state.yml")
404 client := http.Client{}
405 return update.CheckForUpdate(&client, stateFilePath, currentVersion)
406}
407
408// Check whether the CLI was found under the Homebrew prefix
409func isUnderHomebrew(cli string) bool {

Callers 1

ExecuteFunction · 0.85

Calls 3

CheckForUpdateFunction · 0.92
shouldCheckForUpdateFunction · 0.85
GetConfigFolderMethod · 0.80

Tested by

no test coverage detected