MCPcopy
hub / github.com/spicetify/cli / CheckUpdate

Function CheckUpdate

src/cmd/cmd.go:277–294  ·  view source on GitHub ↗

CheckUpdate fetches latest package version from Github API and inform user if there is new release

(version string)

Source from the content-addressed store, hash-verified

275
276// CheckUpdate fetches latest package version from Github API and inform user if there is new release
277func CheckUpdate(version string) {
278 if !settingSection.Key("check_spicetify_update").MustBool() || version == "Dev" {
279 return
280 }
281
282 latestTag, err := utils.FetchLatestTag()
283
284 if err != nil {
285 utils.PrintError("Cannot fetch latest release info")
286 utils.PrintError(err.Error())
287 return
288 }
289
290 if latestTag != version {
291 utils.PrintInfo("New version available: v" + latestTag + " (currently on: v" + version + ")")
292 utils.PrintInfo(`Run "spicetify update" or use a package manager to update spicetify`)
293 }
294}

Callers 2

initFunction · 0.92
mainFunction · 0.92

Calls 3

FetchLatestTagFunction · 0.92
PrintErrorFunction · 0.92
PrintInfoFunction · 0.92

Tested by

no test coverage detected