script to install hooks for clients

This commit is contained in:
Eric Berberich
2012-10-23 23:00:07 +00:00
parent 8f19c3d595
commit bc23fc74d7
2 changed files with 36 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
if [ ! -e .git -o ! -e CMakeLists.txt ];
then
echo "Call $0 from root directory of the CGAL repository"
exit
fi
branch=$(git symbolic-ref HEAD)
branch=${branch/refs\/heads\//}
if [ ! -e .git ];
then
echo "Call $0 from root directory of the CGAL repository"
exit
fi
if [ "$branch" != "master" ];
then
echo "Call $0 from branch 'master'"
exit
fi
echo -n "Fetching from origin ... "
git fetch
echo "done"
echo "Updating hooks ... "
cd .git/hooks
if [ ! -e .git ];
then
git init
fi
git pull .. origin/hooks-for-clients
echo "Hooks updated."
cd ../..