now upgradeCmd is being used, message when downloading, and upgrade need to run as root

This commit is contained in:
2025-10-11 18:50:45 -03:00
parent 4cee062889
commit 7c4fba5c86
2 changed files with 7 additions and 0 deletions

View File

@@ -480,6 +480,10 @@ var upgradeCmd = &cobra.Command{
Short: "upgrade all installed packages",
Run: func(cmd *cobra.Command, args []string) {
if os.Getuid() != 0 {
log.Fatal("you must run this command as root")
}
cfg, err := configs.GetConfigTOML()
if err != nil {
log.Fatal(err)
@@ -523,6 +527,7 @@ func main() {
rootCmd.AddCommand(syncCmd)
rootCmd.AddCommand(listCmd)
rootCmd.AddCommand(searchCmd)
rootCmd.AddCommand(upgradeCmd)
rootCmd.Execute()
}