Commit 7876d50a authored by Andrea Pappacoda's avatar Andrea Pappacoda

Set up commit hook only if master project

If someone is building Pistache from source as a subproject they are not
going to commit any changes from there, and setting up the pre-commit
hook is pointless.
It is now also optional, since git is not stictly needed to build the
library, and if you don't have git installed you are probably not going
to commit.
parent 44e29900
......@@ -112,4 +112,9 @@ if get_option('PISTACHE_BUILD_DOCS')
subdir('docs')
endif
run_command('git', 'config', '--local', 'core.hooksPath', '.hooks')
\ No newline at end of file
if not meson.is_subproject()
git = find_program('git', required: false)
if git.found()
run_command(git, 'config', '--local', 'core.hooksPath', meson.source_root()/'.hooks')
endif
endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment