summaryrefslogtreecommitdiff
path: root/.gitlab/ci.sh
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab/ci.sh')
-rwxr-xr-x.gitlab/ci.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh
index 3bdec79b13..6c030a4e62 100755
--- a/.gitlab/ci.sh
+++ b/.gitlab/ci.sh
@@ -369,13 +369,17 @@ function setup_toolchain() {
function cleanup_submodules() {
start_section "clean submodules"
- info "Cleaning submodules..."
- # On Windows submodules can inexplicably get into funky states where git
- # believes that the submodule is initialized yet its associated repository
- # is not valid. Avoid failing in this case with the following insanity.
- git submodule sync --recursive || git submodule deinit --force --all
- git submodule update --init --recursive
- git submodule foreach git clean -xdf
+ if [ -d .git ]; then
+ info "Cleaning submodules..."
+ # On Windows submodules can inexplicably get into funky states where git
+ # believes that the submodule is initialized yet its associated repository
+ # is not valid. Avoid failing in this case with the following insanity.
+ git submodule sync --recursive || git submodule deinit --force --all
+ git submodule update --init --recursive
+ git submodule foreach git clean -xdf
+ else
+ info "Not cleaning submodules, not in a git repo"
+ fi;
end_section "clean submodules"
}