-
Notifications
You must be signed in to change notification settings - Fork 0
/
conv-commit
63 lines (52 loc) · 1.01 KB
/
conv-commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
conv-commit() {
if (($# == 0)); then
echo "options available: feat, fix, chore, ci, cms, docs, test, refactor, wip"
elif (($# == 2)); then
message="$(tr '[:upper:]' '[:lower:]' <<<${2:0:1})${2:1}"
if [[ ${#message} -gt 100 ]]; then
echo "message longer than 100 characters, (${#message})"
else
git commit -m "$1: $message"
fi
elif (($# == 3)); then
message="$(tr '[:upper:]' '[:lower:]' <<<${3:0:1})${3:1}"
if [[ ${#message} -gt 100 ]]; then
echo "message longer than 100 characters, (${#message})"
else
git commit -m "$1(FCPS-$2): $message"
fi
else
echo 'Wrong number of args'
fi
}
feat() {
conv-commit feat "$@"
}
fix() {
conv-commit fix "$@"
}
chore() {
conv-commit chore "$@"
}
ci() {
conv-commit ci "$@"
}
cms() {
conv-commit cms "$@"
}
docs() {
conv-commit docs "$@"
}
style() {
conv-commit style "$@"
}
test() {
conv-commit test "$@"
}
refactor() {
conv-commit refactor "$@"
}
wip() {
conv-commit wip "$@"
}