From 30eda43192f34c21562e225204cd2c633e908a89 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 20 Jul 2019 12:51:03 -0700 Subject: Moved istty check. --- src/Text/Pandoc/App.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index 92782742c..e6d1f9356 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -122,6 +122,11 @@ convertWithOpts opts = do CRLF -> IO.CRLF LF -> IO.LF Native -> nativeNewline +#ifdef _WINDOWS + let istty = True +#else + istty <- liftIO $ queryTerminal stdOutput +#endif runIO' $ do setUserDataDir datadir @@ -178,11 +183,6 @@ convertWithOpts opts = do -- force this with '-o -'. On posix systems, we detect -- when stdout is being piped and allow output to stdout -- in that case, but on Windows we can't. -#ifdef _WINDOWS - let istty = True -#else - istty <- liftIO $ queryTerminal stdOutput -#endif when (not (isTextFormat format) && istty && isNothing ( optOutputFile opts)) $ throwError $ PandocAppError $ "Cannot write " ++ format ++ " output to terminal.\n" ++ -- cgit v1.2.3