diff --git a/GitHooks.cmake b/GitHooks.cmake index ce447ed..068e389 100644 --- a/GitHooks.cmake +++ b/GitHooks.cmake @@ -11,7 +11,7 @@ endif() # Installing clang-format precommit hook if prerequisites are met and it doesn't # exist yet. -if(GIT_FOUND AND CLANG_FORMAT AND EXISTS ${PROJECT_SOURCE_DIR}/.git AND +if(GIT_FOUND AND CLANG_FORMAT AND EXISTS ${PROJECT_SOURCE_DIR}/.git/hooks/ AND NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/hooks/pre-commit) # We cannot write the file from here because we need exec permissions