-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add git options (commit, stage, and no git repository) (#270)
* Feat: create git step functionality
- Loading branch information
1 parent
ade48aa
commit 323bc07
Showing
9 changed files
with
121 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package flags | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
) | ||
|
||
type Git string | ||
|
||
const ( | ||
Commit = "commit" | ||
Stage = "stage" | ||
Skip = "skip" | ||
) | ||
|
||
var AllowedGitsOptions = []string{string(Commit), string(Stage), string(Skip)} | ||
|
||
func (f Git) String() string { | ||
return string(f) | ||
} | ||
|
||
func (f *Git) Type() string { | ||
return "Git" | ||
} | ||
|
||
func (f *Git) Set(value string) error { | ||
for _, gitOption := range AllowedGitsOptions { | ||
if gitOption == value { | ||
*f = Git(value) | ||
return nil | ||
} | ||
} | ||
|
||
return fmt.Errorf("Git to use. Allowed values: %s", strings.Join(AllowedGitsOptions, ", ")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.