forked from toolshed/abra
		
	refactor: move flags to internal/common
This commit is contained in:
		| @ -295,6 +295,76 @@ var RCFlag = &cli.BoolFlag{ | ||||
| 	Usage:       "Insatll the latest release candidate", | ||||
| } | ||||
|  | ||||
| var Major bool | ||||
| var MajorFlag = &cli.BoolFlag{ | ||||
| 	Name:        "major", | ||||
| 	Usage:       "Increase the major part of the version", | ||||
| 	Value:       false, | ||||
| 	Aliases:     []string{"ma", "x"}, | ||||
| 	Destination: &Major, | ||||
| } | ||||
|  | ||||
| var Minor bool | ||||
| var MinorFlag = &cli.BoolFlag{ | ||||
| 	Name:        "minor", | ||||
| 	Usage:       "Increase the minor part of the version", | ||||
| 	Value:       false, | ||||
| 	Aliases:     []string{"mi", "y"}, | ||||
| 	Destination: &Minor, | ||||
| } | ||||
|  | ||||
| var Patch bool | ||||
| var PatchFlag = &cli.BoolFlag{ | ||||
| 	Name:        "patch", | ||||
| 	Usage:       "Increase the patch part of the version", | ||||
| 	Value:       false, | ||||
| 	Aliases:     []string{"p", "z"}, | ||||
| 	Destination: &Patch, | ||||
| } | ||||
|  | ||||
| var Dry bool | ||||
| var DryFlag = &cli.BoolFlag{ | ||||
| 	Name:        "dry-run", | ||||
| 	Usage:       "No changes are made, only reports changes that would be made", | ||||
| 	Value:       false, | ||||
| 	Aliases:     []string{"d"}, | ||||
| 	Destination: &Dry, | ||||
| } | ||||
|  | ||||
| var Push bool | ||||
| var PushFlag = &cli.BoolFlag{ | ||||
| 	Name:        "push", | ||||
| 	Usage:       "Git push changes", | ||||
| 	Value:       false, | ||||
| 	Aliases:     []string{"P"}, | ||||
| 	Destination: &Push, | ||||
| } | ||||
|  | ||||
| var CommitMessage string | ||||
| var CommitMessageFlag = &cli.StringFlag{ | ||||
| 	Name:        "commit-message", | ||||
| 	Usage:       "Commit message (implies --commit)", | ||||
| 	Aliases:     []string{"cm"}, | ||||
| 	Destination: &CommitMessage, | ||||
| } | ||||
|  | ||||
| var Commit bool | ||||
| var CommitFlag = &cli.BoolFlag{ | ||||
| 	Name:        "commit", | ||||
| 	Usage:       "Commits compose.**yml file changes to recipe repository", | ||||
| 	Value:       false, | ||||
| 	Aliases:     []string{"c"}, | ||||
| 	Destination: &Commit, | ||||
| } | ||||
|  | ||||
| var TagMessage string | ||||
| var TagMessageFlag = &cli.StringFlag{ | ||||
| 	Name:        "tag-comment", | ||||
| 	Usage:       "Description for release tag", | ||||
| 	Aliases:     []string{"t", "tm"}, | ||||
| 	Destination: &TagMessage, | ||||
| } | ||||
|  | ||||
| // SSHFailMsg is a hopefully helpful SSH failure message | ||||
| var SSHFailMsg = ` | ||||
| Woops, Abra is unable to connect to connect to %s. | ||||
|  | ||||
| @ -7,79 +7,8 @@ import ( | ||||
| 	"coopcloud.tech/abra/pkg/recipe" | ||||
| 	"github.com/AlecAivazis/survey/v2" | ||||
| 	"github.com/sirupsen/logrus" | ||||
| 	"github.com/urfave/cli/v2" | ||||
| ) | ||||
|  | ||||
| var Major bool | ||||
| var MajorFlag = &cli.BoolFlag{ | ||||
| 	Name:        "major", | ||||
| 	Usage:       "Increase the major part of the version", | ||||
| 	Value:       false, | ||||
| 	Aliases:     []string{"ma", "x"}, | ||||
| 	Destination: &Major, | ||||
| } | ||||
|  | ||||
| var Minor bool | ||||
| var MinorFlag = &cli.BoolFlag{ | ||||
| 	Name:        "minor", | ||||
| 	Usage:       "Increase the minor part of the version", | ||||
| 	Value:       false, | ||||
| 	Aliases:     []string{"mi", "y"}, | ||||
| 	Destination: &Minor, | ||||
| } | ||||
|  | ||||
| var Patch bool | ||||
| var PatchFlag = &cli.BoolFlag{ | ||||
| 	Name:        "patch", | ||||
| 	Usage:       "Increase the patch part of the version", | ||||
| 	Value:       false, | ||||
| 	Aliases:     []string{"p", "z"}, | ||||
| 	Destination: &Patch, | ||||
| } | ||||
|  | ||||
| var Dry bool | ||||
| var DryFlag = &cli.BoolFlag{ | ||||
| 	Name:        "dry-run", | ||||
| 	Usage:       "No changes are made, only reports changes that would be made", | ||||
| 	Value:       false, | ||||
| 	Aliases:     []string{"d"}, | ||||
| 	Destination: &Dry, | ||||
| } | ||||
|  | ||||
| var Push bool | ||||
| var PushFlag = &cli.BoolFlag{ | ||||
| 	Name:        "push", | ||||
| 	Usage:       "Git push changes", | ||||
| 	Value:       false, | ||||
| 	Aliases:     []string{"P"}, | ||||
| 	Destination: &Push, | ||||
| } | ||||
|  | ||||
| var CommitMessage string | ||||
| var CommitMessageFlag = &cli.StringFlag{ | ||||
| 	Name:        "commit-message", | ||||
| 	Usage:       "Commit message (implies --commit)", | ||||
| 	Aliases:     []string{"cm"}, | ||||
| 	Destination: &CommitMessage, | ||||
| } | ||||
|  | ||||
| var Commit bool | ||||
| var CommitFlag = &cli.BoolFlag{ | ||||
| 	Name:        "commit", | ||||
| 	Usage:       "Commits compose.**yml file changes to recipe repository", | ||||
| 	Value:       false, | ||||
| 	Aliases:     []string{"c"}, | ||||
| 	Destination: &Commit, | ||||
| } | ||||
|  | ||||
| var TagMessage string | ||||
| var TagMessageFlag = &cli.StringFlag{ | ||||
| 	Name:        "tag-comment", | ||||
| 	Usage:       "Description for release tag", | ||||
| 	Aliases:     []string{"t", "tm"}, | ||||
| 	Destination: &TagMessage, | ||||
| } | ||||
|  | ||||
| // PromptBumpType prompts for version bump type | ||||
| func PromptBumpType(tagString string) error { | ||||
| 	if (!Major && !Minor && !Patch) && tagString == "" { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user