Skip to content

Commit

Permalink
Shellcheck check-cabal-files.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
smelc committed Apr 24, 2024
1 parent 5056246 commit 93d2e6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
1 change: 0 additions & 1 deletion .github/workflows/shellcheck-exceptions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
.github/bin/haddocks.sh
scripts/ci/check-cabal-files.sh
15 changes: 8 additions & 7 deletions scripts/ci/check-cabal-files.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 93d2e6e

Please sign in to comment.