CheckUpdate fetches latest package version from Github API and inform user if there is new release
(version string)
| 275 | |
| 276 | // CheckUpdate fetches latest package version from Github API and inform user if there is new release |
| 277 | func 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 | } |
no test coverage detected