adds a rootCmd call if necessary

This commit is contained in:
2025-05-08 20:23:24 +03:00
parent 849a08a791
commit f8c510ab9f
8 changed files with 95 additions and 80 deletions

View File

@ -53,11 +53,7 @@ func UpgradeCmd() *cli.Command {
Usage: gotext.Get("Build package from scratch even if there's an already built package available"),
},
},
Action: func(c *cli.Context) error {
if err := utils.ExitIfNotRoot(); err != nil {
return err
}
Action: utils.RootNeededAction(func(c *cli.Context) error {
if err := utils.ExitIfCantDropCapsToAlrUser(); err != nil {
return err
}
@ -130,7 +126,7 @@ func UpgradeCmd() *cli.Command {
}
return nil
},
}),
}
}