diff --git a/config/app.yaml b/config/app.yaml index 6adeb62..eb1d6a5 100644 --- a/config/app.yaml +++ b/config/app.yaml @@ -6,6 +6,8 @@ author: email: kamontat.c@hotmail.com license: © 2018 Kamontat Chantrachirathumrong versions: + - tag: 1.4.1 + description: Improve list of commit key, and add more commit list - tag: 1.4.0 description: Add more commit list, and public release version - tag: 1.4.0-beta.4 diff --git a/config/commit_list.yaml b/config/commit_list.yaml index 0086aaf..0769253 100644 --- a/config/commit_list.yaml +++ b/config/commit_list.yaml @@ -54,3 +54,10 @@ icon: "\U0001F4F1" name: mortar_board title: Update dependency +- name: Refactor + key: + text: refactor + emoji: + icon: "\U000026FD" + name: fuelpump + title: Refactor code diff --git a/flags/filefolder.go b/flags/filefolder.go deleted file mode 100644 index c09eddf..0000000 --- a/flags/filefolder.go +++ /dev/null @@ -1,11 +0,0 @@ -package flag - -import "github.com/urfave/cli" - -func FileAndFolderFlag() cli.Flag { - return cli.BoolFlag{ - Name: "force, f", - Usage: "force to do something, default: false", - Destination: &isForce, - } -} diff --git a/flags/listversion.go b/flags/list_version.go similarity index 100% rename from flags/listversion.go rename to flags/list_version.go diff --git a/models/config.go b/models/config.go index f77e50d..1f8f03b 100644 --- a/models/config.go +++ b/models/config.go @@ -495,7 +495,7 @@ func GetAppLocation() LocationConfig { func (config ConfigurationFile) CommitAsStringArray() []string { var arr []string for _, c := range config.CommitList { - arr = append(arr, c.Name) + arr = append(arr, fmt.Sprintf("[%s] %s", c.Key.Emoji.Icon, c.Name)) } return arr } @@ -503,14 +503,7 @@ func (config ConfigurationFile) CommitAsStringArray() []string { // GetCommitByName will filter by 'Commit.Name', ignore-case func (config ConfigurationFile) GetCommitByName(key string) (result Commit, err error) { return config.receiveOneCommit(key, func(input Commit) bool { - return strings.Contains(strings.ToLower(input.Name), strings.ToLower(key)) - }) -} - -// GetCommitByTitle will filter by 'Commit.Title', ignore-case -func (config ConfigurationFile) GetCommitByTitle(title string) (result Commit, err error) { - return config.receiveOneCommit(title, func(input Commit) bool { - return strings.Contains(strings.ToLower(input.Title), strings.ToLower(title)) + return strings.Contains(strings.ToLower(fmt.Sprintf("[%s] %s", input.Key.Emoji.Icon, input.Name)), strings.ToLower(key)) }) }