autorestic/cmd/upgrade.go

22 lines
479 B
Go
Raw Permalink Normal View History

2021-04-11 11:04:11 +00:00
package cmd
import (
"github.com/cupcakearmy/autorestic/internal/bins"
"github.com/spf13/cobra"
)
var upgradeCmd = &cobra.Command{
Use: "upgrade",
2021-04-11 11:08:50 +00:00
Short: "Upgrade autorestic and restic",
2021-04-11 11:04:11 +00:00
Run: func(cmd *cobra.Command, args []string) {
noRestic, _ := cmd.Flags().GetBool("no-restic")
err := bins.Upgrade(!noRestic)
CheckErr(err)
2021-04-11 11:04:11 +00:00
},
}
func init() {
rootCmd.AddCommand(upgradeCmd)
upgradeCmd.Flags().Bool("no-restic", false, "Also update restic. Default: true")
}