Created
July 1, 2015 09:46
-
-
Save lesleh/b575e5d2cd99efd5af5e to your computer and use it in GitHub Desktop.
Link git hooks from git repository files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOOKS_DIR=$(dirname $(readlink -f $0))/../.git/hooks | |
echo Linking git hooks | |
cd $HOOKS_DIR | |
find ../../git_hooks/global/ -type f -not -name .keep | while read FILE; do | |
BASE_FILE=$(basename $FILE) | |
if [ ! -e $BASE_FILE ]; then | |
echo Linking $BASE_FILE | |
[ -e $BASE_FILE ] || ln -s $FILE | |
fi | |
done | |
echo Done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment