2016-01-26 06:51:47 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
ARG_DEFS=(
|
|
|
|
"--repository=(.*)"
|
|
|
|
"--directory=(.*)"
|
|
|
|
"[--depth=(.*)]"
|
|
|
|
"[--branch=(.*)]"
|
|
|
|
)
|
|
|
|
|
|
|
|
function run {
|
|
|
|
rm -rf $DIRECTORY
|
|
|
|
mkdir -p $DIRECTORY
|
|
|
|
|
|
|
|
echo "-- Cloning $REPOSITORY#$BRANCH to $DIRECTORY..."
|
|
|
|
|
2016-03-16 04:55:23 +08:00
|
|
|
ARGS="--branch=${BRANCH:-master} --depth=3"
|
2016-01-26 06:51:47 +08:00
|
|
|
if [[ "$DEPTH" != "" ]]; then
|
|
|
|
ARGS="$ARGS --depth=$DEPTH"
|
|
|
|
fi
|
2016-05-05 06:03:53 +08:00
|
|
|
|
|
|
|
git config --global user.email "hi@ionicframework.com"
|
|
|
|
git config --global user.name "Ionitron"
|
|
|
|
|
|
|
|
git clone git@github.com:driftyco/$REPOSITORY.git $DIRECTORY $ARGS
|
2016-01-26 06:51:47 +08:00
|
|
|
cd $DIRECTORY
|
|
|
|
git fetch origin --tags
|
|
|
|
cd ../
|
|
|
|
}
|
|
|
|
|
2016-03-16 06:36:59 +08:00
|
|
|
source $(dirname $0)/../utils.inc.sh
|