From 0c54b565f459996b940cfee9c9cfc2f65614bccf Mon Sep 17 00:00:00 2001 From: Ghasem Shirdel Date: Mon, 17 Jan 2022 20:58:50 +0330 Subject: [PATCH] fix(template.sh): fix limit counter bug --- .../git-commit-template/git-commit-template.plugin.zsh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/plugins/git-commit-template/git-commit-template.plugin.zsh b/plugins/git-commit-template/git-commit-template.plugin.zsh index d4fa3f845..ef224f816 100644 --- a/plugins/git-commit-template/git-commit-template.plugin.zsh +++ b/plugins/git-commit-template/git-commit-template.plugin.zsh @@ -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