X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/17409dcc5a7e9f03a1180cd740b963b53c2ce6ee..704c26980e576b01caf27af751ca5ca08f8f355a:/functest/clone.sh diff --git a/functest/clone.sh b/functest/clone.sh new file mode 100755 index 00000000..f6c7b44b --- /dev/null +++ b/functest/clone.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +BASEPATH=$1 +ARCHIVE=$2 +CURPATH=`pwd` +GIT=/usr/bin/git +TAR=/bin/tar +RM=/bin/rm + +if [ "$BASEPATH" == "" ] +then + printf "Usage: $0 \n" + exit -1 +fi + +if [ ! -d "$BASEPATH" ] +then + printf "Path '$BASEPATH' does not exist or not a directory.\n" + exit -1 +fi + +$GIT clone "https://gitorious.org/stg/stg.git" "$BASEPATH/stg" + +if [ "$ARCHIVE" != "" ] +then + $RM -rf "$BASEPATH/stg/.git" + + $TAR -C "$BASEPATH" -jcf "$BASEPATH/stg.tar" "stg" +fi