diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-07-20 12:59:34 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-07-20 12:59:34 -0700 |
commit | fb73b5c27b8b4e9ef171dc5665f11b8856a53117 (patch) | |
tree | 0e0b586c99914ea22c456a7078d51d786f3a49a3 /src | |
parent | 8435de323621afa05b260f1a8620a31078089dbc (diff) | |
download | pandoc-fb73b5c27b8b4e9ef171dc5665f11b8856a53117.tar.gz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/PDF.hs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs index 2a8842e97..5826f9856 100644 --- a/src/Text/Pandoc/PDF.hs +++ b/src/Text/Pandoc/PDF.hs @@ -42,7 +42,6 @@ import Text.Pandoc.Error (PandocError (PandocPDFProgramNotFoundError)) import Text.Pandoc.MIME (getMimeType) import Text.Pandoc.Options (HTMLMathMethod (..), WriterOptions (..)) import Text.Pandoc.Process (pipeProcess) -import System.Process (readProcess) import Text.Pandoc.Shared (inDirectory, stringify) import qualified Text.Pandoc.UTF8 as UTF8 import Text.Pandoc.Walk (walkM) @@ -90,9 +89,7 @@ makePDF program pdfargs writer opts doc = -- user names (see #777) let withTempDir templ action = do tmp <- getTemporaryDirectory - uname <- E.catch (readProcess "uname" ["-o"] "") - (\(_ :: E.SomeException) -> return "") - if '~' `elem` tmp || uname == "Cygwin" -- see #5451 + if '~' `elem` tmp then withTempDirectory "." templ action else withSystemTempDirectory templ action (newCommonState, res) <- liftIO $ withTempDir "tex2pdf." $ \tmpdir' -> do |