Skip to content

Commit be5efb5

Browse files
committed
fix: run auto-upgrade for all commands, not just bare openboot
Move updater.AutoUpgrade() from RunE (root command only) to PersistentPreRunE so subcommands like snapshot, diff, sync, etc. also trigger the self-update check.
1 parent 4a0f509 commit be5efb5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

internal/cli/root.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ shell configuration, and macOS preferences.`,
3636
# Capture your current environment
3737
openboot snapshot --json > my-setup.json`,
3838
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
39+
updater.AutoUpgrade(version)
40+
3941
if cfg.Silent {
4042
if name := os.Getenv("OPENBOOT_GIT_NAME"); name != "" {
4143
cfg.GitName = name
@@ -71,7 +73,6 @@ shell configuration, and macOS preferences.`,
7173
return nil
7274
},
7375
RunE: func(cmd *cobra.Command, args []string) error {
74-
updater.AutoUpgrade(version)
7576
cfg.Version = version
7677
err := installer.Run(cfg)
7778
if errors.Is(err, installer.ErrUserCancelled) {

0 commit comments

Comments
 (0)