mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-23 22:30:07 +00:00
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.
This commit is contained in:
parent
51f6a87435
commit
0e1841b6d6
1 changed files with 3 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
git_commit_template() {
|
git_commit_template() {
|
||||||
# Check in this directory git exist
|
# Check in this directory git exist
|
||||||
if [ ! -d .git ]; then
|
if [ ! -d .git ]; then
|
||||||
|
echo "fatal: not a git repository (or any of the parent directories): .git"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -107,6 +108,7 @@ octo-org/octo-repo#100\n\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "\n ${GREEN}${type_var}${scope}: ${short_desc}
|
printf "\n ${GREEN}${type_var}${scope}: ${short_desc}
|
||||||
|
|
||||||
${long_desc}
|
${long_desc}
|
||||||
${breaking_changes}
|
${breaking_changes}
|
||||||
${closed_issues}${RESET}\n\n"
|
${closed_issues}${RESET}\n\n"
|
||||||
|
@ -115,6 +117,7 @@ octo-org/octo-repo#100\n\n"
|
||||||
result_code=$?
|
result_code=$?
|
||||||
if [ "$result_code" = 0 ]; then
|
if [ "$result_code" = 0 ]; then
|
||||||
git commit -m "${type_var}${scope}: ${short_desc}
|
git commit -m "${type_var}${scope}: ${short_desc}
|
||||||
|
|
||||||
${long_desc}
|
${long_desc}
|
||||||
${breaking_changes}
|
${breaking_changes}
|
||||||
${closed_issues}"
|
${closed_issues}"
|
||||||
|
|
Loading…
Reference in a new issue