git.iko.soy/typeable/pandoc
on master help sign in
Revert "PDF: create temp dir in . on Cygwin."

This reverts commit 50885eabde6e9ba524d74a234154766f4c522627. Reopens #5451. The problem with the previous commit is that it would lead to spurious messages on stderr on platforms like macOS.

commitfb73b5c27b8b4e9ef171dc5665f11b8856a53117 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 20 Jul 2019, 12:59 (7 years ago) parent8435de3
1 file changed+1−4
src/Text/Pandoc/PDF.hs+1−4
src/Text/Pandoc/PDF.hs+1−4
@@ -42,7 +42,6 @@ import Text.Pandoc.Error (PandocError (PandocPDFProgramNotFoundError))
4242import Text.Pandoc.MIME (getMimeType)
4343import Text.Pandoc.Options (HTMLMathMethod (..), WriterOptions (..))
4444import Text.Pandoc.Process (pipeProcess)
45−import System.Process (readProcess)
4645import Text.Pandoc.Shared (inDirectory, stringify)
4746import qualified Text.Pandoc.UTF8 as UTF8
4847import Text.Pandoc.Walk (walkM)
@@ -90,9 +89,7 @@ makePDF program pdfargs writer opts doc =
9089 -- user names (see #777)
9190 let withTempDir templ action = do
9291 tmp <- getTemporaryDirectory
93− uname <- E.catch (readProcess "uname" ["-o"] "")
94− (\(_ :: E.SomeException) -> return "")
95− if '~' `elem` tmp || uname == "Cygwin" -- see #5451
92+ if '~' `elem` tmp
9693 then withTempDirectory "." templ action
9794 else withSystemTempDirectory templ action
9895 (newCommonState, res) <- liftIO $ withTempDir "tex2pdf." $ \tmpdir' -> do