Skip to content

Commit

Permalink
Made the pre-commit hook fail explicitly when the executable doesn't …
Browse files Browse the repository at this point in the history
…exist
  • Loading branch information
Avamander authored and JF002 committed Jul 24, 2021
1 parent 10ef3a7 commit 1ba99d2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ else
CLANG_FORMAT_EXECUTABLE="clang-format-11"
fi

if ! command -v $CLANG_FORMAT_EXECUTABLE &> /dev/null
then
echo $CLANG_FORMAT_EXECUTABLE does not exist, make sure to install it
exit 1
fi

for FILE in $(git diff --cached --name-only)
do
if [[ "$FILE" =~ src/[A-Za-z0-9\ \-]+*\.(c|h|cpp|cc)$ ]]; then
Expand Down

0 comments on commit 1ba99d2

Please sign in to comment.