Browse Source

Only install git hook if cloned from git.

For source tarballs, the `.git/hooks` folder does not exist, so an error
is shown when running `autogen.sh`. With this change, the hook is not
installed in such cases.
pull/303/head
Joachim Bauch 9 years ago
parent
commit
0c2f59c2a3
  1. 10
      autogen.sh

10
autogen.sh

@ -1,9 +1,11 @@
#!/bin/sh #!/bin/sh
# the pre-commit hook performs various formatting checks if [ -d ".git/hooks" ]; then
if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \); then \ # the pre-commit hook performs various formatting checks
rm -f .git/hooks/pre-commit; \ if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \); then \
ln -s ../../src/hooks/pre-commit.hook .git/hooks/pre-commit; \ rm -f .git/hooks/pre-commit; \
ln -s ../../src/hooks/pre-commit.hook .git/hooks/pre-commit; \
fi
fi fi
if [ -x "`which autoreconf 2>/dev/null`" ] ; then if [ -x "`which autoreconf 2>/dev/null`" ] ; then

Loading…
Cancel
Save