git submodule update --remote only if intervall is reached
This commit is contained in:
parent
f8034875ac
commit
26c97f7ce4
1 changed files with 2 additions and 0 deletions
|
@ -95,9 +95,11 @@ fi
|
||||||
loginfo -n "repo ${GIT_FETCH_OPTIONS:+ and submodules} synced"
|
loginfo -n "repo ${GIT_FETCH_OPTIONS:+ and submodules} synced"
|
||||||
|
|
||||||
if ${MYSHELLCONFIG_GIT_SUBMODULES_UPDATE-${MYSHELLCONFIG_GIT_SUBMODULES_UPDATE_DEFAULT-true}}; then
|
if ${MYSHELLCONFIG_GIT_SUBMODULES_UPDATE-${MYSHELLCONFIG_GIT_SUBMODULES_UPDATE_DEFAULT-true}}; then
|
||||||
|
if [ $updated -lt $(date --date="${MYSHELLCONFIG_GIT_SUBMODULES_UPDATE_INTERVALL} hours ago" "+%s") ]; then
|
||||||
logdebug "$($SGIT submodule update --remote)"
|
logdebug "$($SGIT submodule update --remote)"
|
||||||
logdebug "$($SGIT commit -a -m 'update submodules')"
|
logdebug "$($SGIT commit -a -m 'update submodules')"
|
||||||
date "+%s" > ${MYSHELLCONFIG_BASE%/}${MYSHELLCONFIG_BASE:+/}.last_udate_submodules
|
date "+%s" > ${MYSHELLCONFIG_BASE%/}${MYSHELLCONFIG_BASE:+/}.last_udate_submodules
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
loginfo -n ", submodules not synced"
|
loginfo -n ", submodules not synced"
|
||||||
logdebug "Do not update submodules. It's denied by environment MYSHELLCONFIG_GIT_UPDATE_SUBMODULES: ${MYSHELLCONFIG_GIT_SUBMODULES_UPDATE-${MYSHELLCONFIG_GIT_SUBMODULES_UPDATE_DEFAULT-true}}"
|
logdebug "Do not update submodules. It's denied by environment MYSHELLCONFIG_GIT_UPDATE_SUBMODULES: ${MYSHELLCONFIG_GIT_SUBMODULES_UPDATE-${MYSHELLCONFIG_GIT_SUBMODULES_UPDATE_DEFAULT-true}}"
|
||||||
|
|
Loading…
Reference in a new issue