diff --git a/.githooks/install b/.githooks/install index a98d897d5..5c084603f 100755 --- a/.githooks/install +++ b/.githooks/install @@ -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!"