2012-09-09 08:20:09 +02:00
|
|
|
dir=$1
|
|
|
|
|
|
|
|
if [ ! "$dir" ]; then
|
|
|
|
echo "Usage: $0 /base/folder/to/docs"
|
|
|
|
exit 1
|
2010-08-02 21:59:06 +02:00
|
|
|
fi
|
|
|
|
|
2012-09-09 08:20:09 +02:00
|
|
|
#=== FUNCTION ================================================================
|
|
|
|
# NAME: checkout
|
|
|
|
# DESCRIPTION: Checks out a specific branch of a module into a folder. Not
|
|
|
|
# particular good for taking up space, but at the moment separate
|
|
|
|
# folders for each version we need will do.
|
|
|
|
#
|
|
|
|
# The master branch will checked out by default
|
|
|
|
# PARAMETERS:
|
2014-09-26 04:40:33 +02:00
|
|
|
# $1 - module path on github (e.g silverstripe/silverstripe.git)
|
2012-09-09 08:20:09 +02:00
|
|
|
# $2 - branch name (e.g 3.0)
|
2014-09-26 04:40:33 +02:00
|
|
|
# $3 - module name (e.g framework)
|
2012-09-09 08:20:09 +02:00
|
|
|
#
|
|
|
|
#===============================================================================
|
|
|
|
# Parameters: github path
|
2014-11-14 05:11:28 +01:00
|
|
|
checkout () {
|
2014-09-26 04:40:33 +02:00
|
|
|
echo "Checking out $2/$3 from $1"
|
|
|
|
mkdir -p $dir/src
|
|
|
|
|
2012-11-09 23:19:15 +01:00
|
|
|
if [ ! -d $dir/src/$2 ]; then
|
2014-09-26 04:40:33 +02:00
|
|
|
echo "Cloning git://github.com/$1 into $dir/src/$2"
|
2012-09-09 08:20:09 +02:00
|
|
|
cd $dir/src
|
2014-09-26 04:40:33 +02:00
|
|
|
git clone -q git://github.com/$1 $2
|
|
|
|
cd ../
|
2012-09-09 08:20:09 +02:00
|
|
|
else
|
2012-11-09 23:19:15 +01:00
|
|
|
cd $dir/src/$2
|
2014-09-26 04:40:33 +02:00
|
|
|
git fetch origin
|
|
|
|
git reset --hard -q
|
|
|
|
cd ../../
|
2012-09-09 08:20:09 +02:00
|
|
|
fi
|
|
|
|
|
2012-11-09 23:19:15 +01:00
|
|
|
if [ $# == 3 ]; then
|
|
|
|
if [ -d $dir/src/$2_$3 ]; then
|
2014-09-26 04:40:33 +02:00
|
|
|
cd "$dir/src/$2_$3"
|
2012-11-09 23:19:15 +01:00
|
|
|
else
|
2014-09-26 04:40:33 +02:00
|
|
|
cp -R "$dir/src/$2" "$dir/src/$2_$3"
|
|
|
|
cd "$dir/src/$2_$3"
|
2012-11-09 23:19:15 +01:00
|
|
|
fi
|
|
|
|
|
2014-09-26 04:40:33 +02:00
|
|
|
git reset --hard origin/$3 -q
|
|
|
|
cd ../../
|
2012-09-09 08:20:09 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2012-11-09 23:19:15 +01:00
|
|
|
# core
|
2014-09-26 04:40:33 +02:00
|
|
|
checkout 'silverstripe/silverstripe-framework.git' 'framework' 'master'
|
|
|
|
checkout 'silverstripe/silverstripe-framework.git' 'framework' '3.1'
|
|
|
|
checkout 'silverstripe/silverstripe-framework.git' 'framework' '3.0'
|
|
|
|
checkout 'silverstripe/silverstripe-framework.git' 'framework' '2.4'
|
|
|
|
checkout 'silverstripe/silverstripe-framework.git' 'framework' '2.3'
|
2012-11-09 23:19:15 +01:00
|
|
|
|
|
|
|
# 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'
|
2012-09-09 08:20:09 +02:00
|
|
|
|
2014-11-14 05:11:28 +01:00
|
|
|
echo "Done."
|