Skip to content

Commit edc93bf

Browse files
authored
Merge pull request #1 from nkmr-jp/develp
Add list command.
2 parents 13813dd + 6550873 commit edc93bf

File tree

2 files changed

+50
-9
lines changed

2 files changed

+50
-9
lines changed

Makefile

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,42 @@
11
GITMOJI_VERSION=v3.0.0
22
BASE_FILE=https://raw.githubusercontent.com/carloscuesta/gitmoji/$(GITMOJI_VERSION)/src/data/gitmojis.json
33

4+
# See: https://gist.github.com/rsperl/d2dfe88a520968fbc1f49db0a29345b9
5+
COLOR := $(shell tput -Txterm setaf 5)
6+
RESET := $(shell tput -Txterm sgr0)
7+
48
gen:
5-
@echo ""
6-
@echo "---- Fetch gitmojis.json ($(GITMOJI_VERSION))----"
9+
@echo
10+
@echo "$(COLOR)# Fetch gitmojis.json ($(GITMOJI_VERSION))$(RESET)"
711
mkdir -p build build/src build/dist
812
curl -so build/src/gitmojis.json $(BASE_FILE)
913

10-
@echo ""
11-
@echo ""
12-
@echo "---- Add semver field to gitmojis.json from semver.yml ----"
14+
@echo
15+
@echo
16+
@echo "$(COLOR)# Add semver field$(RESET)"
1317
yq '.' semver.yml > build/src/semver.json
1418
node script.js
1519
cat build/dist/tmp.json | jq > build/dist/gitmojis.json
1620
yq -y '.' build/dist/gitmojis.json > build/dist/gitmojis.yml
1721
rm build/dist/tmp.json
1822

19-
@echo ""
20-
@echo ""
21-
@echo "---- Successfully ----"
22-
@echo "Semver field added to gitmojis.json and gitmojis.yml created"
23+
@echo
24+
@echo
25+
@echo "$(COLOR)# Generated!$(RESET)"
26+
@echo "Generated gitmojis.json and gitmojis.yml whith semver field"
2327
@echo "See ./build/dist"
28+
29+
@echo
30+
@make list
31+
32+
FORMAT={emoji:.emoji, code:.code, desc: .description}
33+
GITMOJI_FILE=build/dist/gitmojis.json
34+
list:
35+
@echo "\n# Major (Breaking)"
36+
@cat $(GITMOJI_FILE) | jq -c '.gitmojis[] | select(.semver=="major") | $(FORMAT)'
37+
@echo "\n# Minor (Feature)"
38+
@cat $(GITMOJI_FILE) | jq -c '.gitmojis[] | select(.semver=="minor") | $(FORMAT)'
39+
@echo "\n# Patch (Fix)"
40+
@cat $(GITMOJI_FILE) | jq -c '.gitmojis[] | select(.semver=="patch") | $(FORMAT)'
41+
@echo "\n# None"
42+
@cat $(GITMOJI_FILE) | jq -c '.gitmojis[] | select(.semver=="none") | $(FORMAT)'

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,28 @@ $ cat build/dist/gitmojis.yml | yq '.gitmojis[] | select(.name=="sparkles")'
5353
}
5454
```
5555

56+
## Show List
57+
```sh
58+
$ make list
59+
# Major (Breaking)
60+
{"emoji":"💥","code":":boom:","desc":"Introduce breaking changes."}
61+
62+
# Minor (Feature)
63+
{"emoji":"","code":":sparkles:","desc":"Introduce new features."}
64+
65+
# Patch (Fix)
66+
{"emoji":"🐛","code":":bug:","desc":"Fix a bug."}
67+
{"emoji":"🚑","code":":ambulance:","desc":"Critical hotfix."}
68+
69+
# None
70+
{"emoji":"🎨","code":":art:","desc":"Improve structure / format of the code."}
71+
{"emoji":"⚡️","code":":zap:","desc":"Improve performance."}
72+
{"emoji":"🔥","code":":fire:","desc":"Remove code or files."}
73+
{"emoji":"📝","code":":memo:","desc":"Add or update documentation."}
74+
{"emoji":"🚀","code":":rocket:","desc":"Deploy stuff."}
75+
...
76+
```
77+
5678
## Edit semver.yml for your project
5779

5880
[./semver.yml](./semver.yml)

0 commit comments

Comments
 (0)