package cmd import ( "gitea.com/jolheiser/beaver" "gitea.com/jolheiser/gpm/modules/config" "github.com/AlecAivazis/survey/v2" "github.com/urfave/cli/v2" ) var Config = cli.Command{ Name: "config", Aliases: []string{"cfg"}, Usage: "Configure local gpm", Action: doConfig, } func doConfig(ctx *cli.Context) error { urlQuestion := &survey.Input{ Message: "gpm URL", Default: config.GPMURL, } var urlAnswer string if err := survey.AskOne(urlQuestion, &urlAnswer); err != nil { return err } config.GPMURL = urlAnswer if err := config.Save(); err != nil { return err } beaver.Info("gpm URL saved!") return nil }