parse all arguments in git-myshellconfig-checkout
This commit is contained in:
parent
bfca3e702f
commit
b7414ca285
1 changed files with 19 additions and 12 deletions
|
@ -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)
|
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case $1 in
|
||||||
|
-h|--headless)
|
||||||
# Headless repo local
|
# Headless repo local
|
||||||
PRE="${MYSHELLCONFIG_GIT_REMOTE_NAME}"
|
PRE="${MYSHELLCONFIG_GIT_REMOTE_NAME}"
|
||||||
|
shift
|
||||||
;;
|
;;
|
||||||
-s)
|
-s|--submodules-update)
|
||||||
dosubmodupdate="true"
|
dosubmodupdate="true"
|
||||||
|
shift
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
PRE=""
|
PRE=""
|
||||||
|
shift
|
||||||
;;
|
;;
|
||||||
esac
|
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=""; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue