From 882c1d52ce6637cfd4ef58d6a275775f912bd92d Mon Sep 17 00:00:00 2001 From: ghasem shirdel Date: Mon, 10 Jan 2022 09:25:00 +0330 Subject: [PATCH] feat(template.sh): add limit counter for short desc Limit character for short descriptions is 50. --- plugins/git-commit-template/git-commit-template.plugin.zsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/git-commit-template/git-commit-template.plugin.zsh b/plugins/git-commit-template/git-commit-template.plugin.zsh index 6baf38e92..d4fa3f845 100644 --- a/plugins/git-commit-template/git-commit-template.plugin.zsh +++ b/plugins/git-commit-template/git-commit-template.plugin.zsh @@ -70,8 +70,12 @@ 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 + printf "${RED}❌ The maximum character for header is 50, Please\ + provide details in long descriptions.${RESET}\n" else break fi