Skip to content

Commit 28dac39

Browse files
committed
fix(prepare-commit-msg.local): fix error msg when git hooks dir doesn't exist
1 parent 54f523b commit 28dac39

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/commands/prepare-commit-msg.local

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ if [ -z "$hooks_dir" ]; then
1111
exit 1
1212
fi
1313

14+
# Check if the global hooks directory exists
15+
if [ ! -d "$hooks_dir" ]; then
16+
printf "Error: Global hooks directory does not exist" >&2
17+
exit 1
18+
fi
19+
1420
# Invoke the prepare-commit-msg hook from the global hooks directory
1521
hook_path="$hooks_dir/prepare-commit-msg"
1622
if [ -x "$hook_path" ]; then

0 commit comments

Comments
 (0)