diff --git a/.github/workflows/shellcheck-exceptions.txt b/.github/workflows/shellcheck-exceptions.txt index 1b11a1d293..916498abb7 100644 --- a/.github/workflows/shellcheck-exceptions.txt +++ b/.github/workflows/shellcheck-exceptions.txt @@ -1,2 +1 @@ .github/bin/haddocks.sh -scripts/ci/check-cabal-files.sh diff --git a/scripts/ci/check-cabal-files.sh b/scripts/ci/check-cabal-files.sh index 2cd8ae36fb..5771c266d5 100755 --- a/scripts/ci/check-cabal-files.sh +++ b/scripts/ci/check-cabal-files.sh @@ -1,10 +1,11 @@ #!/usr/bin/env bash +# +# Runs "cabal check" in all directories containing a versioned .cabal file -for x in $(find . -name '*.cabal' | grep -v dist-newstyle | cut -c 3-); do - ( - d=$(dirname $x) - echo "== $d ==" - cd $d - cabal check - ) +for cabal_file in $(git ls-files "*.cabal") +do + cd "$(dirname "$cabal_file")" || { echo "Cannot cd"; exit 1; } + echo "$(pwd)> cabal-check" + cabal check + cd - || { echo "Cannot cd back"; exit 1; } done