diff --git a/exe/Main.hs b/exe/Main.hs index 3331c9e..12e6c16 100644 --- a/exe/Main.hs +++ b/exe/Main.hs @@ -147,11 +147,10 @@ runMonitoredCommand :: Config -> Process.ProcessConfig () () () -> IO Process.Ex runMonitoredCommand config process_config = do let process_config_with_handles = Process.setStdout Process.createPipe - $ Process.setStderr - Process.createPipe - process_config - Exception.handle ((ExitFailure 1 <$) . printIOException) - $ Process.withProcessWait process_config_with_handles \process -> do + . Process.setStderr Process.createPipe + $ process_config + Exception.handle ((ExitFailure 1 <$) . printIOException) $ + Process.withProcessWait process_config_with_handles \process -> do void $ monitorHandle @NixJSONMessage config (Process.getStderr process) exitCode <- Process.waitExitCode process output <- ByteString.hGetContents (Process.getStdout process)