Created
June 4, 2012 22:45
-
-
Save blkperl/2871290 to your computer and use it in GitHub Desktop.
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 | |
cd $HOME/supernexus | |
branch="PECVD_Master" | |
lock="/tmp/githooklock" | |
if mkdir $lock; then | |
echo "Locking nexus superproject succeeded" >&2 | |
else | |
echo "Locking nexus superproject failed - exit" >&2 | |
exit 1 | |
fi | |
# Track latest changes to submodules | |
git submodule sync | |
git submodule foreach --recursive "git clean -d -x -f" | |
git submodule foreach --recursive "git checkout $branch" | |
git submodule foreach --recursive "git fetch origin $branch" | |
git submodule foreach --recursive "git reset --hard origin/$branch" | |
if [ "`git status | wc -l`" -eq "2" ]; then | |
echo "No Changes for nexus superproject" | |
else | |
echo "Pushing changes to nexus superproject on $branch" | |
git commit -a -m "hook: Track latest changes to nexus" | |
git push origin $branch | |
fi | |
wait | |
rmdir $lock |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment