Skip to content

Commit 2574b54

Browse files
committed
feat(template.sh): add sign to gct
1 parent 100b40f commit 2574b54

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

template.sh

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/bash
22

3+
# Check the current folder is a git repository
4+
$(git -C $PWD rev-parse)
5+
if [[ $? != 0 ]]; then
6+
exit 1
7+
fi
8+
39
# Color formatting
410
RED="\033[0;31m"
511
GREEN="\033[0;32m"
@@ -122,14 +128,22 @@ fi
122128
printf "${massage}\n${RESET}"
123129

124130
# Git commit
125-
result_code=$?
126-
if [ "$result_code" = 0 ]; then
127-
git commit -m "${type_var}${scope}: ${short_desc}
131+
if [ $? == 0 ]; then
132+
if [[ $1 == "-s" ]] || [[ $1 == "sign" ]]; then
133+
git commit -S -m "${type_var}${scope}: ${short_desc}
134+
135+
${long_desc}
136+
${breaking_changes}
137+
${closed_issues}"
138+
else
139+
git commit -m "${type_var}${scope}: ${short_desc}
128140
129141
${long_desc}
130142
${breaking_changes}
131143
${closed_issues}"
144+
fi
132145
else
133146
printf "\n${RED}❌ An error occurred. Please try again.${RESET}\n"
134147
exit 1
135148
fi
149+

0 commit comments

Comments
 (0)