update submodules only if wanted (configure by env

This commit is contained in:
Jakobus Schürz 2020-10-25 11:08:37 +01:00
parent 0ede14c873
commit d57655e575
2 changed files with 20 additions and 25 deletions

View file

@ -36,9 +36,10 @@ if [[ $- = *i* ]] ; then
[ -z "${GIT_AUTHOR_EMAIL+x}" ] && export GIT_AUTHOR_EMAIL=$USEREMAIL [ -z "${GIT_AUTHOR_EMAIL+x}" ] && export GIT_AUTHOR_EMAIL=$USEREMAIL
[ -z "${GIT_COMMITTER_NAME+x}" ] && export GIT_COMMITTER_NAME=$FULLNAME [ -z "${GIT_COMMITTER_NAME+x}" ] && export GIT_COMMITTER_NAME=$FULLNAME
[ -z "${GIT_COMMITTER_EMAIL+x}" ] && export GIT_COMMITTER_EMAIL=$USEREMAIL [ -z "${GIT_COMMITTER_EMAIL+x}" ] && export GIT_COMMITTER_EMAIL=$USEREMAIL
[ -z "${MYSHELLCONFIG_GIT_TIMEOUT+x}" ] && MYSHELLCONFIG_GIT_TIMEOUT=5s [ -z "${MYSHELLCONFIG_GIT_TIMEOUT+x}" ] && export MYSHELLCONFIG_GIT_TIMEOUT=5s
[ -z "${MYSHELLCONFIG_GIT_CHECKOUT_TIMEOUT+x}" ] && MYSHELLCONFIG_GIT_CHECKOUT_TIMEOUT=20s [ -z "${MYSHELLCONFIG_GIT_CHECKOUT_TIMEOUT+x}" ] && export MYSHELLCONFIG_GIT_CHECKOUT_TIMEOUT=20s
[ -z "${MYSHELLCONFIG_GIT_SYNC+x}" ] && MYSHELLCONFIG_GIT_SYNC=true [ -z "${MYSHELLCONFIG_GIT_SYNC+x}" ] && export MYSHELLCONFIG_GIT_SYNC=true
[ -z "${MYSHELLCONFIG_GIT_UPDATE_SUBMODULES_DEFAULT+x}" ] && export MYSHELLCONFIG_GIT_UPDATE_SUBMODULES_DEFAULT=true
# hardcoded git # hardcoded git
export SGIT="git -C ${MYSHELLCONFIG_BASE}" export SGIT="git -C ${MYSHELLCONFIG_BASE}"

View file

@ -81,11 +81,8 @@ EOF
fi fi
cat << EOF >> "${MYSHELLCONFIG_LOGFILE}" if ${MYSHELLCONFIG_GIT_UPDATE_SUBMODLUES-${MYSHELLCONFIG_GIT_UPDATE_SUBMODULES_DEFAULT-true}}; then
logdebug "update submodules"
+-----update submodules $(date) ---------------------------------+
EOF
rc=0 rc=0
logdebug "update submodules" >&2 logdebug "update submodules" >&2
@ -97,11 +94,8 @@ $SGIT submodule foreach "git branch -u origin/master master" 1>>"${MYSHELLCONFI
$SGIT submodule update --recursive --remote --merge 1>>"${MYSHELLCONFIG_LOGFILE}" 2>&1 || { logwarn " update submodules failed on update"; rc=9; } $SGIT submodule update --recursive --remote --merge 1>>"${MYSHELLCONFIG_LOGFILE}" 2>&1 || { logwarn " update submodules failed on update"; rc=9; }
logdebug "submodules updated" >&2 logdebug "submodules updated" >&2
cat << EOF >> "${MYSHELLCONFIG_LOGFILE}" logdebug "update submodules ENDE"
+-----ENDE $(date) ---------------------------------+
EOF
EXIT EXIT
exit $rc exit $rc