Skip to content

Commit

Permalink
Fix formatting scripts for MSYS2
Browse files Browse the repository at this point in the history
  • Loading branch information
jasagredo committed Jul 19, 2024
1 parent ad53873 commit 4ec64a6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
12 changes: 11 additions & 1 deletion scripts/ci/run-cabal-gild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,14 @@ if ! command -v "$fdcmd" &> /dev/null; then
fi
fi

$fdcmd --full-path "$(pwd)/(ouroboros-consensus|sop-extras|strict-sop-core)" -e cabal -x cabal-gild -i {} -o {}
case "$(uname -s)" in
MINGW*) path="$(pwd -W | sed 's_/_\\\\_g')\\\\(ouroboros-consensus|sop-extras|strict-sop-core)";;
*) path="$(pwd)/(ouroboros-consensus|sop-extras|strict-sop-core)";;
esac

$fdcmd --full-path "$path" -e cabal -x cabal-gild -i {} -o {}

case "$(uname -s)" in
MINGW*) git ls-files --eol | grep "w/crlf" | awk '{print $4}' | xargs dos2unix;;
*) ;;
esac
13 changes: 12 additions & 1 deletion scripts/ci/run-stylish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ if ! command -v "$fdcmd" &> /dev/null; then
exit 1
fi
fi
$fdcmd --full-path "$(pwd)/(ouroboros-consensus|scripts|sop-extras|strict-sop-core)" \

case "$(uname -s)" in
MINGW*) path="$(pwd -W | sed 's_/_\\\\_g')\\\\(ouroboros-consensus|sop-extras|strict-sop-core)";;
*) path="$(pwd)/(ouroboros-consensus|sop-extras|strict-sop-core)";;
esac

$fdcmd --full-path "$path" \
--extension hs \
--exclude Setup.hs \
--exclude ouroboros-consensus-cardano/app/DBAnalyser/Parsers.hs \
Expand All @@ -28,3 +34,8 @@ $fdcmd --full-path "$(pwd)/(ouroboros-consensus|scripts|sop-extras|strict-sop-co
grep "#if __GLASGOW_HASKELL__ < 900
import Data.Foldable (asum)
#endif" ouroboros-consensus-cardano/app/DBAnalyser/Parsers.hs >/dev/null 2>&1

case "$(uname -s)" in
MINGW*) git ls-files --eol | grep "w/crlf" | awk '{print $4}' | xargs dos2unix;;
*) ;;
esac

0 comments on commit 4ec64a6

Please sign in to comment.