diff --git a/.gitlab-ci/run-shellcheck.sh b/.gitlab-ci/run-shellcheck.sh index a445b7b6693..79d8ab3597a 100755 --- a/.gitlab-ci/run-shellcheck.sh +++ b/.gitlab-ci/run-shellcheck.sh @@ -9,15 +9,14 @@ is_bash() { return 1 } +anyfailed=0 + while IFS= read -r -d $'' file; do if is_bash "$file" ; then - shellcheck -x -W0 -s bash "$file" - rc=$? - if [ "${rc}" -eq 0 ] - then - continue - else - exit 1 + if ! shellcheck -x -W0 -s bash "$file"; then + anyfailed=1 fi fi done < <(find "$SCRIPTS_DIR" -type f \! -path "./.git/*" -print0) + +exit "$anyfailed"