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) {
|
2021-10-30 12:50:27 +00:00
|
|
|
restic, _ := cmd.Flags().GetBool("restic")
|
|
|
|
err := bins.Upgrade(restic)
|
2021-04-11 15:02:34 +00:00
|
|
|
CheckErr(err)
|
2021-04-11 11:04:11 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
rootCmd.AddCommand(upgradeCmd)
|
2021-10-30 12:50:27 +00:00
|
|
|
upgradeCmd.Flags().Bool("restic", true, "also update restic")
|
2021-04-11 11:04:11 +00:00
|
|
|
}
|