autorestic/cmd/upgrade.go

22 lines
452 B
Go
Raw Normal View History

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