Skip to content

Commit 4ec64a6

Browse files
committed
Fix formatting scripts for MSYS2
1 parent ad53873 commit 4ec64a6

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

scripts/ci/run-cabal-gild.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,14 @@ if ! command -v "$fdcmd" &> /dev/null; then
1414
fi
1515
fi
1616

17-
$fdcmd --full-path "$(pwd)/(ouroboros-consensus|sop-extras|strict-sop-core)" -e cabal -x cabal-gild -i {} -o {}
17+
case "$(uname -s)" in
18+
MINGW*) path="$(pwd -W | sed 's_/_\\\\_g')\\\\(ouroboros-consensus|sop-extras|strict-sop-core)";;
19+
*) path="$(pwd)/(ouroboros-consensus|sop-extras|strict-sop-core)";;
20+
esac
21+
22+
$fdcmd --full-path "$path" -e cabal -x cabal-gild -i {} -o {}
23+
24+
case "$(uname -s)" in
25+
MINGW*) git ls-files --eol | grep "w/crlf" | awk '{print $4}' | xargs dos2unix;;
26+
*) ;;
27+
esac

scripts/ci/run-stylish.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ if ! command -v "$fdcmd" &> /dev/null; then
1818
exit 1
1919
fi
2020
fi
21-
$fdcmd --full-path "$(pwd)/(ouroboros-consensus|scripts|sop-extras|strict-sop-core)" \
21+
22+
case "$(uname -s)" in
23+
MINGW*) path="$(pwd -W | sed 's_/_\\\\_g')\\\\(ouroboros-consensus|sop-extras|strict-sop-core)";;
24+
*) path="$(pwd)/(ouroboros-consensus|sop-extras|strict-sop-core)";;
25+
esac
26+
27+
$fdcmd --full-path "$path" \
2228
--extension hs \
2329
--exclude Setup.hs \
2430
--exclude ouroboros-consensus-cardano/app/DBAnalyser/Parsers.hs \
@@ -28,3 +34,8 @@ $fdcmd --full-path "$(pwd)/(ouroboros-consensus|scripts|sop-extras|strict-sop-co
2834
grep "#if __GLASGOW_HASKELL__ < 900
2935
import Data.Foldable (asum)
3036
#endif" ouroboros-consensus-cardano/app/DBAnalyser/Parsers.hs >/dev/null 2>&1
37+
38+
case "$(uname -s)" in
39+
MINGW*) git ls-files --eol | grep "w/crlf" | awk '{print $4}' | xargs dos2unix;;
40+
*) ;;
41+
esac

0 commit comments

Comments
 (0)