1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-23 14:20:08 +00:00

refactor(template.sh): some refactoring

This commit is contained in:
Ghasem Shirdel 2022-01-24 11:43:05 +03:30 committed by GitHub
parent 30a451b213
commit 80ec398a5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,3 +1,10 @@
# Color formatting
RED="\033[0;31m"
GREEN="\033[0;32m"
BLUE="\033[1;34m"
CYAN="\033[0;36m"
RESET="\033[0m"
git_commit_template() { git_commit_template() {
# Check the current folder is a git repository # Check the current folder is a git repository
@ -6,13 +13,6 @@ git_commit_template() {
exit 1 exit 1
fi fi
# Color formatting
RED="\033[0;31m"
GREEN="\033[0;32m"
BLUE="\033[1;34m"
CYAN="\033[0;36m"
RESET="\033[0m"
# Valid types # Valid types
TYPES=("feat" "fix" "docs" "style" "refactor" TYPES=("feat" "fix" "docs" "style" "refactor"
"pref" "test" "build" "ci" "chore" "revert") "pref" "test" "build" "ci" "chore" "revert")
@ -118,11 +118,11 @@ octo-org/octo-repo#100\n\n"
fi fi
if [ ! -z "$breaking_changes" ]; then if [ ! -z "$breaking_changes" ]; then
massage="${massage} BREAKING CHANGE: ${breaking_changes}\n" massage="${massage}\n BREAKING CHANGE: ${breaking_changes}\n"
fi fi
if [ ! -z "$closed_issues" ]; then if [ ! -z "$closed_issues" ]; then
massage="${massage} ${closed_issues}\n" massage="${massage}\n ${closed_issues}\n"
fi fi
printf "${massage}\n${RESET}" printf "${massage}\n${RESET}"
@ -133,13 +133,17 @@ octo-org/octo-repo#100\n\n"
git commit -S -m "${type_var}${scope}: ${short_desc} git commit -S -m "${type_var}${scope}: ${short_desc}
${long_desc} ${long_desc}
${breaking_changes} ${breaking_changes}
${closed_issues}" ${closed_issues}"
else else
git commit -m "${type_var}${scope}: ${short_desc} git commit -m "${type_var}${scope}: ${short_desc}
${long_desc} ${long_desc}
${breaking_changes} ${breaking_changes}
${closed_issues}" ${closed_issues}"
fi fi
else else