add in extra parms

This commit is contained in:
Trevor Batley 2023-06-13 09:36:51 +10:00
parent 94f7e151c0
commit 9c4d268e3d

View File

@ -8,7 +8,7 @@ if [ ! -e $inifilename ] ; then
# Not here, look at system default # Not here, look at system default
if [ ! -e /etc/smegit.ini ] ; then if [ ! -e /etc/smegit.ini ] ; then
echo "No ini file found $inifiename or /etc/smegit.ini" echo "No ini file found $inifiename or /etc/smegit.ini"
echo "get-repo-and-build.sh <organisation> <reponame> [<local>]" echo "get-repo-and-build.sh <organisation> <reponame> [<local> <debug>]"
exit 1 exit 1
else else
initfilename="/etc/smegit.ini" initfilename="/etc/smegit.ini"
@ -35,7 +35,27 @@ if [[ -z $1 && -z $2 ]] ; then
fi fi
DEBUG= DEBUG=
GITEAHOST=${remote_GITEAHOST}
ACCESSTOKEN=${remote_GITEAACCESSTOKEN}
ORG_NAME="$2"
REPO_NAME="$1"
if [ ${smegit_DEBUG} == "true" ] ; then DEBUG=true ; fi if [ ${smegit_DEBUG} == "true" ] ; then DEBUG=true ; fi
for param in $3 $4 $5 $6; do
if [ $param ] ; then
case $param in
local )
GITEAHOST=${local_GITEAHOST}
ACCESSTOKEN=${local_GITEAACCESSTOKEN}
;;
debug )
DEBUG=true ;;
* )
TARGETORG=$param ;;
esac
else
break
fi
done
if [ $DEBUG ] ; then echo "found ini file: $inifilename" ; fi if [ $DEBUG ] ; then echo "found ini file: $inifilename" ; fi
SILENT="-s" SILENT="-s"
@ -47,12 +67,6 @@ fi
GITEAHOST=${remote_GITEAHOST} GITEAHOST=${remote_GITEAHOST}
ACCESSTOKEN=${remote_GITEAACCESSTOKEN} ACCESSTOKEN=${remote_GITEAACCESSTOKEN}
if [ $3 ] ; then
if [ $3 == "local" ] ; then
GITEAHOST=${local_GITEAHOST}
ACCESSTOKEN=${local_GITEAACCESSTOKEN}
fi
fi
ORG_NAME="$2" ORG_NAME="$2"
REPO_NAME="$1" REPO_NAME="$1"
if [[ $smegit_WORKDIR == ~* ]] ; then if [[ $smegit_WORKDIR == ~* ]] ; then