File tree Expand file tree Collapse file tree 2 files changed +29
-7
lines changed
Expand file tree Collapse file tree 2 files changed +29
-7
lines changed Original file line number Diff line number Diff line change 22
33set -euo pipefail
44
5- fd --full-path " $( pwd) /(ouroboros-consensus|sop-extras|strict-sop-core)" -e cabal -x cabal-fmt -i
5+ # First, try to find the 'fd' command
6+ fdcmd=" fd"
7+ if ! command -v " $fdcmd " & > /dev/null; then
8+ # In Ubuntu systems the fd command is called fdfind.
9+ # If 'fd' is not found, try 'fdfind'
10+ fdcmd=" fdfind"
11+ if ! command -v " $fdcmd " & > /dev/null; then
12+ echo " Error: Neither 'fd' nor 'fdfind' command found." >&2
13+ exit 1
14+ fi
15+ fi
16+
17+ $fdcmd --full-path " $( pwd) /(ouroboros-consensus|sop-extras|strict-sop-core)" -e cabal -x cabal-fmt -i
Original file line number Diff line number Diff line change @@ -7,12 +7,22 @@ stylish-haskell --defaults | diff - ./.stylish-haskell.yaml | grep -E "^>.*[[:al
77printf " \nFormatting haskell files...\n"
88
99export LC_ALL=C.UTF-8
10- fd --full-path " $( pwd) /(ouroboros-consensus|scripts|sop-extras|strict-sop-core)" \
11- --extension hs \
12- --exclude Setup.hs \
13- --exclude ouroboros-consensus-cardano/app/DBAnalyser/Parsers.hs \
14- --exec-batch stylish-haskell -c .stylish-haskell.yaml -i
15-
10+ # First, try to find the 'fd' command
11+ fdcmd=" fd"
12+ if ! command -v " $fdcmd " & > /dev/null; then
13+ # In Ubuntu systems the fd command is called fdfind.
14+ # If 'fd' is not found, try 'fdfind'
15+ fdcmd=" fdfind"
16+ if ! command -v " $fdcmd " & > /dev/null; then
17+ echo " Error: Neither 'fd' nor 'fdfind' command found." >&2
18+ exit 1
19+ fi
20+ fi
21+ $fdcmd --full-path " $( pwd) /(ouroboros-consensus|scripts|sop-extras|strict-sop-core)" \
22+ --extension hs \
23+ --exclude Setup.hs \
24+ --exclude ouroboros-consensus-cardano/app/DBAnalyser/Parsers.hs \
25+ --exec-batch stylish-haskell -c .stylish-haskell.yaml -i
1626
1727# We don't want these deprecation warnings to be removed accidentally
1828grep " #if __GLASGOW_HASKELL__ < 900
You can’t perform that action at this time.
0 commit comments