summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgit-hooks/clang-format-pre-commit7
1 files changed, 6 insertions, 1 deletions
diff --git a/git-hooks/clang-format-pre-commit b/git-hooks/clang-format-pre-commit
index 8b18541..9689d74 100755
--- a/git-hooks/clang-format-pre-commit
+++ b/git-hooks/clang-format-pre-commit
@@ -12,7 +12,12 @@
# mklink pre-commit ..\..\..\qtrepotools\git-hooks\clang-format-pre-commit
#
-CLANG_FORMAT=`which git-clang-format`
+CLANG_FORMAT=$(which git-clang-format)
+if [ -z "$CLANG_FORMAT" -a -d "$LLVM_INSTALL_DIR" ]; then
+ export PATH=$PATH:$LLVM_INSTALL_DIR/bin
+ CLANG_FORMAT=$(which git-clang-format)
+fi
+
if test -z "$CLANG_FORMAT"; then
echo "Please install clang-format and make sure git-clang-format is in the path."
exit 0