Last active
October 17, 2016 09:43
-
-
Save lambda2/1257a2b0bfd3be23c6f9f0859a1ba984 to your computer and use it in GitHub Desktop.
PandaCore basic pre-commit hook
This file contains 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
if [ -d "./.git" ]; then | |
echo "Installing hook..." | |
cat > .git/hooks/pre-commit <<- EOM | |
#!/bin/zsh | |
echo "Updating Gemfile to PandaCore latest." | |
if [ -d "$GIT_DIR/../../panda_core" ]; then | |
echo "Pulling panda core..." | |
(cd "$GIT_DIR/../../panda_core" && git branch --set-upstream-to=origin/master master && git pull origin) || echo "Failed to pull PandaCore, you're not on the master branch, so you should pull it yourself." | |
fi | |
bundle update panda_core | |
EOM | |
chmod +x .git/hooks/pre-commit | |
echo "👌" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment