mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-15 01:48:34 -07:00
refactor(template.sh): some refactoring
This commit is contained in:
parent
30a451b213
commit
80ec398a5c
@ -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() {
|
||||
|
||||
# Check the current folder is a git repository
|
||||
@ -6,13 +13,6 @@ git_commit_template() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Color formatting
|
||||
RED="\033[0;31m"
|
||||
GREEN="\033[0;32m"
|
||||
BLUE="\033[1;34m"
|
||||
CYAN="\033[0;36m"
|
||||
RESET="\033[0m"
|
||||
|
||||
# Valid types
|
||||
TYPES=("feat" "fix" "docs" "style" "refactor"
|
||||
"pref" "test" "build" "ci" "chore" "revert")
|
||||
@ -118,11 +118,11 @@ octo-org/octo-repo#100\n\n"
|
||||
fi
|
||||
|
||||
if [ ! -z "$breaking_changes" ]; then
|
||||
massage="${massage} BREAKING CHANGE: ${breaking_changes}\n"
|
||||
massage="${massage}\n BREAKING CHANGE: ${breaking_changes}\n"
|
||||
fi
|
||||
|
||||
if [ ! -z "$closed_issues" ]; then
|
||||
massage="${massage} ${closed_issues}\n"
|
||||
massage="${massage}\n ${closed_issues}\n"
|
||||
fi
|
||||
|
||||
printf "${massage}\n${RESET}"
|
||||
@ -133,13 +133,17 @@ octo-org/octo-repo#100\n\n"
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user