parse all arguments in git-myshellconfig-checkout

This commit is contained in:
Jakobus Schürz 2020-11-15 22:10:29 +01:00
parent bfca3e702f
commit b7414ca285

View file

@ -33,18 +33,25 @@ cat << EOF >> "${MYSHELLCONFIG_LOGFILE}"
+-----BEGINN git update repo $(date) -------------------------------+ +-----BEGINN git update repo $(date) -------------------------------+
EOF EOF
case $1 in set -- $(getopt -u -o hs --long headless,submodules-update -- "$@" )
-h)
# Headless repo local while [ $# -gt 0 ]; do
PRE="${MYSHELLCONFIG_GIT_REMOTE_NAME}" case $1 in
;; -h|--headless)
-s) # Headless repo local
dosubmodupdate="true" PRE="${MYSHELLCONFIG_GIT_REMOTE_NAME}"
;; shift
*) ;;
PRE="" -s|--submodules-update)
;; dosubmodupdate="true"
esac shift
;;
*)
PRE=""
shift
;;
esac
done
# If TAG is set, checkout is always headless. # If TAG is set, checkout is always headless.
[ -z "${MYSHELLCONFIG_GIT_TAG:+x}" ] || { export MYSHELLCONFIG_GIT_BRANCH=${MYSHELLCONFIG_GIT_TAG}; export PRE=""; } [ -z "${MYSHELLCONFIG_GIT_TAG:+x}" ] || { export MYSHELLCONFIG_GIT_BRANCH=${MYSHELLCONFIG_GIT_TAG}; export PRE=""; }