mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 16:52:53 +08:00
27 lines
500 B
Bash
Executable File
27 lines
500 B
Bash
Executable File
#!/bin/bash
|
|
|
|
ARG_DEFS=(
|
|
"--repository=(.*)"
|
|
"--directory=(.*)"
|
|
"[--depth=(.*)]"
|
|
"[--branch=(.*)]"
|
|
)
|
|
|
|
function run {
|
|
rm -rf $DIRECTORY
|
|
mkdir -p $DIRECTORY
|
|
|
|
echo "-- Cloning $REPOSITORY#$BRANCH to $DIRECTORY..."
|
|
|
|
ARGS="--branch=${BRANCH:-master}"
|
|
if [[ "$DEPTH" != "" ]]; then
|
|
ARGS="$ARGS --depth=$DEPTH"
|
|
fi
|
|
git clone https://driftyco:$GH_TOKEN@github.com/$REPOSITORY $DIRECTORY $ARGS
|
|
cd $DIRECTORY
|
|
git fetch origin --tags
|
|
cd ../
|
|
}
|
|
|
|
source $(dirname $0)/../utils.sh.inc
|