git.iko.soy/typeable/pandoc
on master help sign in
Made detection of latex program more robust.

Catch not-found error. Improves on 285bbf61cf2b21278792e48aee7c25fa0ee62faa to fix #2903.

commit02993c2cc7bccc0e89911c48aa66396bbd42d513 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 10 May 2016, 09:29 (10 years ago) parent285bbf6
1 file changed+5−2
pandoc.hs+5−2
pandoc.hs+5−2
@@ -1,4 +1,4 @@
1−{-# LANGUAGE CPP, TupleSections #-}
1+{-# LANGUAGE CPP, TupleSections, ScopedTypeVariables #-}
22{-
33Copyright (C) 2006-2016 John MacFarlane <jgm@berkeley.edu>
44
@@ -1402,7 +1402,10 @@ convertWithOpts opts args = do
14021402 _ | html5Output -> "wkhtmltopdf"
14031403 _ -> latexEngine
14041404 -- check for pdf creating program
1405− (ec,_,_) <- readProcessWithExitCode pdfprog ["--version"] ""
1405+ (ec,_,_) <- E.catch
1406+ (readProcessWithExitCode pdfprog ["--version"] "")
1407+ (\(_ :: E.SomeException) ->
1408+ return (ExitFailure 1,"",""))
14061409 when (ec /= ExitSuccess) $
14071410 err 41 $ pdfprog ++ " not found. " ++
14081411 pdfprog ++ " is needed for pdf output."