]> git.stg.codes - stg.git/blob - functest/clone.sh
Merge branch 'stg-2.409-radius'
[stg.git] / functest / clone.sh
1 #!/bin/sh
2
3 BASEPATH=$1
4 ARCHIVE=$2
5 CURPATH=`pwd`
6 GIT=/usr/bin/git
7 TAR=/bin/tar
8 RM=/bin/rm
9
10 if [ "$BASEPATH" == "" ]
11 then
12     printf "Usage: $0 <path>\n"
13     exit -1
14 fi
15
16 if [ ! -d "$BASEPATH" ]
17 then
18     printf "Path '$BASEPATH' does not exist or not a directory.\n"
19     exit -1
20 fi
21
22 #$GIT clone "https://gitorious.org/stg/stg.git" "$BASEPATH/stg"
23 $GIT clone "../" "$BASEPATH/stg"
24
25 if [ "$ARCHIVE" != "" ]
26 then
27     $RM -rf "$BASEPATH/stg/.git"
28
29     $TAR -C "$BASEPATH" -jcf "$BASEPATH/stg.tar" "stg"
30 fi