summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2020-03-30 17:13:30 +0200
committerAndreas Klebinger <klebinger.andreas@gmx.at>2020-03-31 10:58:32 -0400
commit4edffcbba6c4ff80b02a5e566a0622622baeaa1f (patch)
tree5a49cc38f4338099c270e4537e04ecaf39bc390f
parent4b9c586472bf99425f7bbcf346472d7c54f05028 (diff)
downloadhaskell-wip/andreask/tools_unlines.tar.gz
Turn newlines into spaces for hadrian/ghci.wip/andreask/tools_unlines
The newlines break the command on windows.
-rwxr-xr-xhadrian/ghci-cabal3
-rwxr-xr-xhadrian/ghci-stack3
2 files changed, 4 insertions, 2 deletions
diff --git a/hadrian/ghci-cabal b/hadrian/ghci-cabal
index 93343e4e28..2ee70427c3 100755
--- a/hadrian/ghci-cabal
+++ b/hadrian/ghci-cabal
@@ -2,5 +2,6 @@
set -e
-GHC_FLAGS="$GHC_FLAGS $(TERM=dumb CABFLAGS=-v0 "hadrian/build-cabal" tool-args -q --build-root=.hadrian_ghci --flavour=ghc-in-ghci "$@")"
+# Replace newlines with spaces, as these otherwise break the ghci invocation on windows.
+GHC_FLAGS="$GHC_FLAGS $(TERM=dumb CABFLAGS=-v0 "hadrian/build-cabal" tool-args -q --build-root=.hadrian_ghci --flavour=ghc-in-ghci "$@" | tr '\n\r' ' ')"
ghci $GHC_FLAGS "$@" -fno-code -fwrite-interface -hidir=.hadrian_ghci/interface -O0 ghc/Main.hs +RTS -A128m
diff --git a/hadrian/ghci-stack b/hadrian/ghci-stack
index 3c850cdac8..92b5229328 100755
--- a/hadrian/ghci-stack
+++ b/hadrian/ghci-stack
@@ -2,5 +2,6 @@
set -e
-GHC_FLAGS="$GHC_FLAGS $(TERM=dumb CABFLAGS=-v0 "hadrian/build-stack" tool-args -q --build-root=.hadrian_ghci --flavour=ghc-in-ghci "$@")"
+# Replace newlines with spaces, as these otherwise break the ghci invocation on windows.
+GHC_FLAGS="$GHC_FLAGS $(TERM=dumb CABFLAGS=-v0 "hadrian/build-stack" tool-args -q --build-root=.hadrian_ghci --flavour=ghc-in-ghci "$@" | tr '\n\r' ' ')"
stack exec -- ghci $GHC_FLAGS "$@" -fno-code -fwrite-interface -hidir=.hadrian_ghci/interface -O0 ghc/Main.hs +RTS -A128m