aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/App.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-07-18 18:53:55 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-07-18 18:55:12 -0700
commitd7edfbdf4d0680dcbc6cb1e7ed01e64c13db0871 (patch)
tree0dad91ba13d5c76625a5054e3e5bba779d926f48 /src/Text/Pandoc/App.hs
parente1eeb663fca3a03acc8724d56673352730b9fddc (diff)
downloadpandoc-d7edfbdf4d0680dcbc6cb1e7ed01e64c13db0871.tar.gz
Fix regression finding templates in user data directory.
Under version 2.2.1 and prior pandoc found latex templates in the templates directory under the data directory, but this no longer works in 2.2.2. MANUAL says: "If the template is not found, pandoc will search for it in the templates subdirectory of the user data directory (see `--data-dir`)." This commit fixes the regression, which stems from 07bce91. Closes #4777.
Diffstat (limited to 'src/Text/Pandoc/App.hs')
-rw-r--r--src/Text/Pandoc/App.hs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs
index b79273092..f4b7f1904 100644
--- a/src/Text/Pandoc/App.hs
+++ b/src/Text/Pandoc/App.hs
@@ -83,7 +83,6 @@ import System.Exit (exitSuccess)
import System.FilePath
import System.IO (nativeNewline, stdout)
import qualified System.IO as IO (Newline (..))
-import System.IO.Error (isDoesNotExistError)
import Text.Pandoc
import Text.Pandoc.BCP47 (Lang (..), parseBCP47)
import Text.Pandoc.Builder (setMeta, deleteMeta)
@@ -383,8 +382,7 @@ convertWithOpts opts = do
((fst <$> fetchItem tp') `catchError`
(\e ->
case e of
- PandocIOError _ e' |
- isDoesNotExistError e' ->
+ PandocResourceNotFound _ ->
readDataFile ("templates" </> tp')
_ -> throwError e))