add system default ini and allow ~ in workdir
This commit is contained in:
@@ -4,12 +4,16 @@
|
||||
# monitor results and log
|
||||
#
|
||||
inifilename=$(echo ~)"/.smegit/config"
|
||||
if [ -z $inifilename ] ; then
|
||||
# Not here, look a bit further up
|
||||
echo "No ini file found $inifiename"
|
||||
echo "get-repo-and-build.sh <organisation> <reponame> [<local>]"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -e $inifilename ] ; then
|
||||
# Not here, look at system default
|
||||
if [ ! -e /etc/smegit.ini ] ; then
|
||||
echo "No ini file found $inifiename or /etc/smegit.ini"
|
||||
echo "get-repo-and-build.sh <organisation> <reponame> [<local>]"
|
||||
exit 1
|
||||
else
|
||||
initfilename="/etc/smegit.ini"
|
||||
fi
|
||||
fi
|
||||
while read -r line || [[ -n "$line" ]]; do
|
||||
if [[ $line =~ ^\[.*\]$ ]]
|
||||
then
|
||||
@@ -47,7 +51,14 @@ if [ $3 ] ; then
|
||||
fi
|
||||
ORG_NAME="$1"
|
||||
REPO_NAME="$2"
|
||||
WORKDIR=$(echo ~)${smegit_WORKDIR}
|
||||
if [[ $smegit_WORKDIR == ~* ]] ; then
|
||||
# relative to users home dir
|
||||
WORKDIR=$(echo ~)${smegit_WORKDIR:1}
|
||||
else
|
||||
# absolute path
|
||||
WORKDIR=${smegit_WORKDIR}
|
||||
fi
|
||||
if [ $DEBUG ] ; then echo "WORKDIR=$WORKDIR" ; fi
|
||||
GITFiles=$WORKDIR/GITFiles/$ORG_NAME
|
||||
REPOURL="$GITEAHOST/$ORG_NAME/$REPO_NAME.git"
|
||||
|
||||
|
Reference in New Issue
Block a user