1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-23 22:30:07 +00:00

feat(template.sh): add sign to gct

To sign committees, just set the GPG for the git and then sign the template with `-s` or `sign` args.
This commit is contained in:
Ghasem Shirdel 2022-01-23 10:12:44 +03:30 committed by GitHub
parent caf9c3bd6d
commit b1ee81f4f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,11 @@
git_commit_template() {
# Check the current folder is a git repository
$(git -C $PWD rev-parse)
if [[ $? != 0 ]]; then
exit 1
fi
# Color formatting
RED="\033[0;31m"
GREEN="\033[0;32m"
@ -122,13 +128,20 @@ octo-org/octo-repo#100\n\n"
printf "${massage}\n${RESET}"
# Git commit
result_code=$?
if [ "$result_code" = 0 ]; then
git commit -m "${type_var}${scope}: ${short_desc}
if [ $? == 0 ]; then
if [[ $1 == "-s" ]] || [[ $1 == "sign" ]]; then
git commit -S -m "${type_var}${scope}: ${short_desc}
${long_desc}
${breaking_changes}
${closed_issues}"
else
git commit -m "${type_var}${scope}: ${short_desc}
${long_desc}
${breaking_changes}
${closed_issues}"
fi
else
printf "\n${RED}❌ An error occurred. Please try again.${RESET}\n"
exit 1