fix update mirror and make opt-in with --china-mirrors (#1035)

This commit is contained in:
henrygd
2025-08-29 13:42:30 -04:00
parent b084814aea
commit 94245a9ba4
6 changed files with 130 additions and 59 deletions

View File

@@ -45,11 +45,13 @@ func getBaseApp() *pocketbase.PocketBase {
baseApp.RootCmd.Use = beszel.AppName
baseApp.RootCmd.Short = ""
// add update command
baseApp.RootCmd.AddCommand(&cobra.Command{
updateCmd := &cobra.Command{
Use: "update",
Short: "Update " + beszel.AppName + " to the latest version",
Run: hub.Update,
})
}
updateCmd.Flags().Bool("china-mirrors", false, "Use mirror (gh.beszel.dev) instead of GitHub")
baseApp.RootCmd.AddCommand(updateCmd)
// add health command
baseApp.RootCmd.AddCommand(newHealthCmd())