Created
February 21, 2014 10:50
-
-
Save mfojtik/9132356 to your computer and use it in GitHub Desktop.
devenv-sync
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
#!/bin/bash | |
bold=`tput bold` | |
normal=`tput sgr0` | |
devenv() { | |
pushd /home/mfojtik/code/rh/li &>/dev/null | |
./build/devenv "$@" | |
popd &> /dev/null | |
} | |
pushd $HOME/code/rh >/dev/null | |
for sync_dir in {origin-server,li,origin-dev-tools}; do | |
pushd $HOME/code/rh/$sync_dir >/dev/null | |
current_branch=`git rev-parse --abbrev-ref HEAD` | |
if [ "$current_branch" != "master" ]; then | |
echo -ne "[${sync_dir}@${bold}${current_branch}${normal}] Switch back to 'master' (y/N) ?" | |
read answer | |
if [ "$answer" == "y" ]; then | |
git checkout master | |
if [ "$?" != "0" ]; then | |
echo "ERROR: Cannot switch to master, please fix this manually." | |
exit 1 | |
fi | |
fi | |
fi | |
popd >/dev/null | |
done | |
echo "Syncing repositories..." | |
devenv sync verifier | |
popd >/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment