Created
February 4, 2015 20:33
-
-
Save RomkeVdMeulen/5978f733f6d48542fa62 to your computer and use it in GitHub Desktop.
Script for automatically updating a number of projects in your workspace
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 | |
############################################### | |
# # | |
# Auto-update externals # | |
# # | |
# Will go into your workspace (~/workspace) # | |
# and `git pull` all projects listed in # | |
# .git-auto-pull, and will `svn up` all # | |
# projects listed in .svn-auto-up # | |
# # | |
############################################### | |
cd ~/workspace/ | |
if [ -f .git-auto-pull ]; then | |
for project in `cat .git-auto-pull | tr "\n" ' '`; do | |
echo "Updating $project..." | |
cd $project | |
git branch | |
git pull | |
cd - > /dev/null | |
echo | |
done | |
fi | |
if [ -f .svn-auto-up ]; then | |
for project in `cat .svn-auto-up | tr "\n" ' '`; do | |
echo "Updating $project..." | |
cd $project | |
svn up | |
cd - > /dev/null | |
echo | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment