Enhancements to update script to make checking out non core folders easier

This commit is contained in:
Will Rossiter 2012-11-10 11:19:15 +13:00 committed by Sam Minnee
parent 7a20cd8a60
commit eeb14bfa0d

View File

@ -20,36 +20,51 @@ fi
#=============================================================================== #===============================================================================
# Parameters: github path # Parameters: github path
function checkout { function checkout {
if [ ! -d $dir/src/$3 ]; then if [ ! -d $dir/src/$2 ]; then
echo "Cloning $1 " echo "Cloning $1 "
mkdir $dir/src mkdir $dir/src
cd $dir/src cd $dir/src
git clone --depth=100 -q git://github.com/$1 $3 --quiet git clone --depth=100 -q git://github.com/$1 $2 --quiet
cd $3 cd $2
git checkout master -q git checkout -q origin/master
else else
cd $dir/src/$3 cd $dir/src/$2
git pull -q git pull -q origin master
git checkout master -q git checkout -q origin/master
fi fi
echo "Checking out $2 from $1 into $3_$2" if [ $# == 3 ]; then
echo "Checking out $2 from $1 into $2_$3"
if [ -d $dir/src/$3_$2 ]; then if [ -d $dir/src/$2_$3 ]; then
cd $dir/src/$3_$2 cd $dir/src/$2_$3
else
cp -R $dir/src/$2 $dir/src/$2_$3
cd $dir/src/$2_$3
fi
git reset --hard -q
git checkout $3 -q
else else
cp -R $dir/src/$3 $dir/src/$3_$2 echo "Checking out $2 from $1 into $2"
cd $dir/src/$3_$2
fi fi
git reset --hard -q
git checkout $2 -q
git pull -q
} }
checkout 'silverstripe/sapphire.git' 'master' 'framework' # core
checkout 'silverstripe/sapphire.git' '3.0' 'framework' checkout 'silverstripe/sapphire.git' 'framework' 'master'
checkout 'silverstripe/sapphire.git' '2.4' 'framework' checkout 'silverstripe/sapphire.git' 'framework' '3.0'
checkout 'silverstripe/sapphire.git' '2.3' 'framework' checkout 'silverstripe/sapphire.git' 'framework' '2.4'
checkout 'silverstripe/sapphire.git' 'framework' '2.3'
# core modules with docs
checkout 'silverstripe/silverstripe-cms.git' 'cms' '3.0'
# checkout 'silverstripe/silverstripe-docsviewer.git' 'docsviewer'
# checkout 'silverstripe/silverstripe-forum.git' 'forum'
# checkout 'silverstripe/silverstripe-translatable.git' 'translatable'
# checkout 'silverstripe/silverstripe-subsites.git' 'subsites'
# popular labs projects
# checkout 'silverstripe-labs/silverstripe-staticpublisher.git' 'staticpublisher'
echo "Done." echo "Done."