Files
wehub-resource-sync 26f897c1ec
release / release-please (push) Failing after 1m49s
docs / build (push) Failing after 6m34s
release / build-and-upload (arm64, linux) (push) Has been cancelled
release / build-and-upload (arm64, windows) (push) Has been cancelled
release / build-darwin (amd64, darwin) (push) Has been cancelled
release / checksums (push) Has been cancelled
release / finalize (push) Has been cancelled
release / build-darwin (arm64, darwin) (push) Has been cancelled
release / build-and-upload (amd64, linux) (push) Has been cancelled
release / build-and-upload (amd64, windows) (push) Has been cancelled
docs / deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:34:16 +08:00

28 lines
928 B
Go

package cli
import (
"github.com/kunchenguid/no-mistakes/internal/update"
"github.com/spf13/cobra"
)
func newUpdateCmd() *cobra.Command {
var beta bool
var yes bool
var force bool
cmd := &cobra.Command{
Use: "update",
Short: "Update no-mistakes and reset the daemon",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
logLifecycleInvocation("update", force)
return trackCommand("update", func() error {
return update.Run(cmd.Context(), cmd.OutOrStdout(), cmd.ErrOrStderr(), update.RunOptions{Beta: beta, Yes: yes, Force: force, Stdin: cmd.InOrStdin()})
})
},
}
cmd.Flags().BoolVar(&beta, "beta", false, "install the latest release including prereleases")
cmd.Flags().BoolVarP(&yes, "yes", "y", false, "answer yes to update safety prompts")
cmd.Flags().BoolVar(&force, "force", false, "update and restart the daemon even when pipeline runs are active")
return cmd
}