Last active
October 20, 2015 17:07
-
-
Save timlevett/54ce2adc08a9e8823387 to your computer and use it in GitHub Desktop.
Checkout a bunch of projects under a SVN repo
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
function look_and_co_if_trunk { | |
BASE_URL=$1 | |
PARENT=$2 | |
SUPER_BASE=${BASE_URL}${PARENT} | |
LIST=`svn list $SUPER_BASE` | |
if [ "`echo $LIST | grep trunk | wc -l`" = "1" ] ; then | |
echo "found trunk at $SUPER_BASE" | |
svn co $SUPER_BASE/trunk ${PARENT} | |
SUPER_BASE=$BASE_URL | |
else | |
for item in $LIST ; do | |
echo "recursively calling into $item"; | |
look_and_co_if_trunk $SUPER_BASE $item | |
done | |
SUPER_BASE=$BASE_URL | |
fi | |
} | |
look_and_co_if_trunk $1 |
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
for item in `ls` ; do pushd $item; svn update; popd; done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for item in
ls
; do pushd $item; for chi inls
; do pushd $chi; svn update; popd; done; popd; done;