check_submodules.sh force update if in CI

This commit is contained in:
Daniel Agar 2017-12-11 15:15:26 -05:00
parent 87646c4ea4
commit f01400d407
1 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@
function check_git_submodule { function check_git_submodule {
# The .git exists in a submodule if init and update have been done. # The .git exists in a submodule if init and update have been done.
if [ -f $1"/.git" ] || [ -d $1"/.git" ]; if [ "$CI" != "true" ] && [[ -f $1"/.git" || -d $1"/.git" ]];
then then
SUBMODULE_STATUS=$(git submodule summary "$1") SUBMODULE_STATUS=$(git submodule summary "$1")
STATUSRETVAL=$(echo $SUBMODULE_STATUS | grep -A20 -i "$1") STATUSRETVAL=$(echo $SUBMODULE_STATUS | grep -A20 -i "$1")
@ -45,8 +45,8 @@ then
fi fi
else else
git submodule sync --recursive -- $1 git submodule sync --recursive -- $1
git submodule update --init --recursive -- $1 || true git submodule update --init --recursive --force -- $1 || true
git submodule update --init --recursive -- $1 git submodule update --init --recursive --force -- $1
fi fi
} }