Skip to content

Instantly share code, notes, and snippets.

@n8foo
Created July 31, 2015 17:15
Show Gist options
  • Save n8foo/d97acc9b5625d0af8525 to your computer and use it in GitHub Desktop.
Save n8foo/d97acc9b5625d0af8525 to your computer and use it in GitHub Desktop.
#! /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