From 0e1841b6d608f8fdaac8920ace878f5a0fd355a1 Mon Sep 17 00:00:00 2001 From: ghasem shirdel Date: Mon, 10 Jan 2022 09:22:24 +0330 Subject: [PATCH] fix(template.sh): fix decription for non git directory When we are in a non-git folder, if we use the 'gct' command, we will also see the reason for the error. --- plugins/git-commit-template/git-commit-template.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/git-commit-template/git-commit-template.plugin.zsh b/plugins/git-commit-template/git-commit-template.plugin.zsh index 06f7bd829..6baf38e92 100644 --- a/plugins/git-commit-template/git-commit-template.plugin.zsh +++ b/plugins/git-commit-template/git-commit-template.plugin.zsh @@ -1,6 +1,7 @@ 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 @@ -107,6 +108,7 @@ octo-org/octo-repo#100\n\n" fi printf "\n ${GREEN}${type_var}${scope}: ${short_desc} + ${long_desc} ${breaking_changes} ${closed_issues}${RESET}\n\n" @@ -115,6 +117,7 @@ octo-org/octo-repo#100\n\n" result_code=$? if [ "$result_code" = 0 ]; then git commit -m "${type_var}${scope}: ${short_desc} + ${long_desc} ${breaking_changes} ${closed_issues}"