From e84f9a69595241520f88f6e197f7f905067aa747 Mon Sep 17 00:00:00 2001 From: perry Date: Mon, 25 Jan 2016 16:51:47 -0600 Subject: [PATCH] chore(circle): circle scripts require git scripts --- scripts/git/clone.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 scripts/git/clone.sh diff --git a/scripts/git/clone.sh b/scripts/git/clone.sh new file mode 100755 index 000000000..07a064575 --- /dev/null +++ b/scripts/git/clone.sh @@ -0,0 +1,26 @@ +#!/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