Skip to content

Commit 40445c7

Browse files
committed
Filter out '/r' characters from stdout/stderr streams for windows
1 parent 5ecf41d commit 40445c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/HIE/Bios/Cradle.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,13 +520,13 @@ readProcessWithOutputFile l work_dir fp args = withSystemTempFile "bios-output"
520520
let process = (proc fp args) { cwd = Just work_dir
521521
, env = Just (("HIE_BIOS_OUTPUT", output_file) : old_env)
522522
}
523-
loggingConduit = (C.decodeUtf8 C..| C.lines C..| C.map unpack C..| C.iterM l C..| C.sinkList)
523+
-- Windows line endings are not converted so you have to filter out `'r` characters
524+
loggingConduit = (C.decodeUtf8 C..| C.lines C..| C.filterE (/= '\r') C..| C.map unpack C..| C.iterM l C..| C.sinkList)
524525
(ex, stdo, stde) <- sourceProcessWithStreams process mempty loggingConduit loggingConduit
525526
!res <- force <$> hGetContents h
526527
return (ex, stdo, stde, lines res)
527528

528529

529-
530530
makeCradleResult :: (ExitCode, [String], [String]) -> [FilePath] -> CradleLoadResult ComponentOptions
531531
makeCradleResult (ex, err, gopts) deps =
532532
case ex of

0 commit comments

Comments
 (0)