git.iko.soy/typeable/pandoc
on master help sign in
Revert "PDF: create temp dir in . on Cygwin."
fb73b5cJohn MacFarlane
src/Text/Pandoc/PDF.hs+1−4
@@ -42,7 +42,6 @@ import Text.Pandoc.Error (PandocError (PandocPDFProgramNotFoundError))
42import Text.Pandoc.MIME (getMimeType)
42import Text.Pandoc.MIME (getMimeType)
43import Text.Pandoc.Options (HTMLMathMethod (..), WriterOptions (..))
43import Text.Pandoc.Options (HTMLMathMethod (..), WriterOptions (..))
44import Text.Pandoc.Process (pipeProcess)
44import Text.Pandoc.Process (pipeProcess)
45−import System.Process (readProcess)
46import Text.Pandoc.Shared (inDirectory, stringify)
45import Text.Pandoc.Shared (inDirectory, stringify)
47import qualified Text.Pandoc.UTF8 as UTF8
46import qualified Text.Pandoc.UTF8 as UTF8
48import Text.Pandoc.Walk (walkM)
47import Text.Pandoc.Walk (walkM)
@@ -90,9 +89,7 @@ makePDF program pdfargs writer opts doc =
90 -- user names (see #777)
89 -- user names (see #777)
91 let withTempDir templ action = do
90 let withTempDir templ action = do
92 tmp <- getTemporaryDirectory
91 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
96 then withTempDirectory "." templ action
93 then withTempDirectory "." templ action
97 else withSystemTempDirectory templ action
94 else withSystemTempDirectory templ action
98 (newCommonState, res) <- liftIO $ withTempDir "tex2pdf." $ \tmpdir' -> do
95 (newCommonState, res) <- liftIO $ withTempDir "tex2pdf." $ \tmpdir' -> do