Last active
August 29, 2015 14:21
-
-
Save tapannallan/701d3c22ebb5a709504b to your computer and use it in GitHub Desktop.
githookup
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/sh | |
#title :git-hookup | |
#description :Custom git command. | |
#author :[email protected] | |
#date :20150730 | |
#version :0.5 | |
#usage :git hookup | |
#notes : | |
#============================================================================== | |
echo JDA Software Pvt Ltd | |
is_git_dir=`ls -ap | grep .git/` | |
if [ "$is_git_dir" = ".git/" ]; then | |
if [ -e .hooks ]; then | |
cd .hooks | |
cnt=`ls -1|wc -l` | |
echo Searching for client hooks : $cnt found | |
FILES=* | |
for f in $FILES | |
do | |
if [[ "$f" != *\.* ]] | |
then | |
if [ -e "../.git/hooks/$f" ]; | |
then | |
echo "Error : An instance of $f hook was already found in the .git/hooks directory" | |
echo "You need to manually merge .hooks/$f with .git/hooks/$f" | |
else | |
cp "$f" "../.git/hooks/$f" | |
echo "Installed $f hook" | |
fi | |
fi | |
done | |
fi | |
else | |
echo This is not a git repo. Nothing to do here. | |
exit 0 | |
fi | |
echo You are hooked up now. Commit when you are ready. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment