mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-25 13:51:57 +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:
parent
caf9c3bd6d
commit
b1ee81f4f0
1 changed files with 16 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue