mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2025-12-13 02:40:40 +01: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:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user