1
1
GITMOJI_VERSION =v3.0.0
2
2
BASE_FILE =https://raw.githubusercontent.com/carloscuesta/gitmoji/$(GITMOJI_VERSION ) /src/data/gitmojis.json
3
3
4
+ # See: https://gist.github.com/rsperl/d2dfe88a520968fbc1f49db0a29345b9
5
+ COLOR := $(shell tput -Txterm setaf 5)
6
+ RESET := $(shell tput -Txterm sgr0)
7
+
4
8
gen :
5
- @echo " "
6
- @echo " ---- Fetch gitmojis.json ($( GITMOJI_VERSION) )---- "
9
+ @echo
10
+ @echo " $( COLOR ) # Fetch gitmojis.json ($( GITMOJI_VERSION) )$( RESET ) "
7
11
mkdir -p build build/src build/dist
8
12
curl -so build/src/gitmojis.json $(BASE_FILE )
9
13
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) "
13
17
yq '.' semver.yml > build/src/semver.json
14
18
node script.js
15
19
cat build/dist/tmp.json | jq > build/dist/gitmojis.json
16
20
yq -y '.' build/dist/gitmojis.json > build/dist/gitmojis.yml
17
21
rm build/dist/tmp.json
18
22
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 "
23
27
@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)'
0 commit comments