Created
July 31, 2015 17:15
-
-
Save n8foo/d97acc9b5625d0af8525 to your computer and use it in GitHub Desktop.
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 | |
WD=`pwd` | |
DOMAIN=example.com | |
GITS=`find . -maxdepth 2 -name .git -type d | sed "s/\.\///g" | sed "s/\/.*//g"` | |
SVNS=`find . -maxdepth 2 -name .svn -type d | sed "s/\.\///g" | sed "s/\/.*//g"` | |
case $1 in | |
setup) | |
for GIT in $GITS | |
do | |
echo "cloning $GIT..." | |
git clone http://git.$DOMAIN/$GIT | |
done | |
for SVN in $SVNS | |
do | |
echo "checking out $SVN from SVN" | |
svn co https://svn.$DOMAIN/$SVN | |
done | |
;; | |
*) | |
for GIT in $GITS | |
do | |
echo "updating $GIT..." | |
cd $WD/$GIT | |
git pull | |
done | |
for SVN in $SVNS | |
do | |
echo "updating $SVN" | |
cd $WD/$SVN; svn up | |
done | |
;; | |
esac | |
cd $WD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment