feat: add update command and callback for version checking and upgrading

This commit is contained in:
krau
2025-08-24 14:16:26 +08:00
parent 764be2a083
commit 492900bbef
6 changed files with 133 additions and 8 deletions

View File

@@ -26,7 +26,7 @@ var upgradeCmd = &cobra.Command{
Short: "Upgrade saveany-bot to the latest version",
Run: func(cmd *cobra.Command, args []string) {
v := semver.MustParse(config.Version)
latest, err := selfupdate.UpdateSelf(v, "krau/SaveAny-Bot")
latest, err := selfupdate.UpdateSelf(v, config.GitRepo)
if err != nil {
fmt.Println("Binary update failed:", err)
return