Skip to content

Commit

Permalink
add gitmoji suggestions for some emoji love
Browse files Browse the repository at this point in the history
❤️

fixes #40
  • Loading branch information
chriswalz committed Oct 30, 2020
1 parent 2389581 commit 64ec04e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/rootShell.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func CreateSuggestionMap(cmd *cobra.Command) (map[string]func() []prompt.Suggest
gitResetSuggestions := GitResetSuggestions()
log.Debug().Msg((time.Now().Sub(start)).String())
start = time.Now()
gitmoji := GitmojiSuggestions()

completerSuggestionMap := map[string]func() []prompt.Suggest{
"": memoize([]prompt.Suggest{}),
Expand All @@ -88,6 +89,7 @@ func CreateSuggestionMap(cmd *cobra.Command) (map[string]func() []prompt.Suggest
}),
"reset": memoize(gitResetSuggestions),
"pr": lazyLoad(GitHubPRSuggestions),
"gitmoji": memoize(gitmoji),
//"_any": commonCommands,
}
return completerSuggestionMap, bitCmdMap
Expand Down
14 changes: 14 additions & 0 deletions cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,20 @@ func BranchListSuggestions() []prompt.Suggest {
return suggestions
}

func GitmojiSuggestions() []prompt.Suggest {
gitmojiList := []string{
"🔒 Fix security issues",
"💚 Fix CI build",
}
var suggestions []prompt.Suggest
for _, gitmoji := range gitmojiList {
suggestions = append(suggestions, prompt.Suggest{
Text: gitmoji,
})
}
return suggestions
}

func GitAddSuggestions() []prompt.Suggest {
fileChanges := FileChangesList()
var suggestions []prompt.Suggest
Expand Down

0 comments on commit 64ec04e

Please sign in to comment.