diff options
Diffstat (limited to 'src/Text/Pandoc/Shared.hs')
-rw-r--r-- | src/Text/Pandoc/Shared.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 2f40c904f..5657321d8 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -1044,9 +1044,9 @@ inDirectory path action = do setCurrentDirectory oldDir return result --- | Read file from user data directory or, if not found there, from --- Cabal data directory. On unix the user data directory is @$HOME/.pandoc@. -readDataFile :: FilePath -> IO String -readDataFile fname = do - userDir <- getAppUserDataDirectory "pandoc" - catch (readFile $ userDir </> fname) (\_ -> getDataFileName fname >>= readFile) +-- | Read file from specified user data directory or, if not found there, from +-- Cabal data directory. +readDataFile :: FilePath -> FilePath -> IO String +readDataFile userDir fname = catch + (readFile $ userDir </> fname) + (\_ -> getDataFileName fname >>= readFile) |