mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2025-09-02 08:40:39 +00:00
error handling for upgrade and uninstall
This commit is contained in:
@@ -9,13 +9,13 @@ var upgradeCmd = &cobra.Command{
|
||||
Use: "upgrade",
|
||||
Short: "Upgrade autorestic and restic",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
noRestic, _ := cmd.Flags().GetBool("no-restic")
|
||||
err := bins.Upgrade(!noRestic)
|
||||
restic, _ := cmd.Flags().GetBool("restic")
|
||||
err := bins.Upgrade(restic)
|
||||
CheckErr(err)
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(upgradeCmd)
|
||||
upgradeCmd.Flags().Bool("no-restic", false, "also update restic")
|
||||
upgradeCmd.Flags().Bool("restic", true, "also update restic")
|
||||
}
|
||||
|
Reference in New Issue
Block a user