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

fix(template.sh): fix limit counter bug

This commit is contained in:
Ghasem Shirdel 2022-01-17 20:58:50 +03:30 committed by GitHub
parent 882c1d52ce
commit 0c54b565f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,9 +1,4 @@
git_commit_template() {
# Check in this directory git exist
if [ ! -d .git ]; then
echo "fatal: not a git repository (or any of the parent directories): .git"
exit 1
fi
# Color formatting
RED="\033[0;31m"
@ -70,10 +65,9 @@ a file name, function name, class name, component name etc.\n\n"
while :; do
read -e short_desc
limit_counter=${#short_desc}
if [ -z "$short_desc" ]; then
printf "${RED}❌ Short description can not be empty.${RESET}\n"
elif [[ $limit_counter > 50 ]]; then
elif [[ ${#limit_counter} -gt 50 ]]; then
printf "${RED}❌ The maximum character for header is 50, Please\
provide details in long descriptions.${RESET}\n"
else