Skip to content

Commit

Permalink
Add git-clang-format check when installing pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Beanavil committed May 28, 2024
1 parent 818da84 commit 8a73fca
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .githooks/install
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
cd "$(git rev-parse --git-dir)"
cd hooks

echo "Installing hooks..."
ln -s ../../.githooks/pre-commit pre-commit
echo "Installing hooks..."
# Install pre-commit hook if dependencies are satisfied
if ! [ -x "$(command -v git-clang-format)" ]; then
echo 'Error: pre-commit hook depends on git-clang-format, but is not installed.' >&2
exit 1
else
ln -s ../../.githooks/pre-commit pre-commit
fi
echo "Done!"

0 comments on commit 8a73fca

Please sign in to comment.