diff options
| author | Mirek Kratochvil <exa.exa@gmail.com> | 2023-10-23 20:05:46 +0200 |
|---|---|---|
| committer | Mirek Kratochvil <exa.exa@gmail.com> | 2023-10-23 20:44:49 +0200 |
| commit | 7a60fce085b5ae8d9f17699489415f20a5f18f8c (patch) | |
| tree | d5e6e55a5aaa16423f754ed457d1f1721b6f81b5 /Utils.hs | |
| parent | e3d1f22ff17e82c530ba755824600fd033283538 (diff) | |
| download | reploy-7a60fce085b5ae8d9f17699489415f20a5f18f8c.tar.gz reploy-7a60fce085b5ae8d9f17699489415f20a5f18f8c.tar.bz2 | |
switch to a safe version of </>
Diffstat (limited to 'Utils.hs')
| -rw-r--r-- | Utils.hs | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -28,7 +28,7 @@ import System.Directory , doesDirectoryExist , getDirectoryContents ) -import System.FilePath ((</>), splitDirectories, takeDirectory) +import System.FilePath (splitDirectories, takeDirectory) import Text.Pandoc.Definition import qualified Text.Pandoc.Walk import Types @@ -96,6 +96,16 @@ unAbsolute = dropWhile (== '/') withPandocBlocks :: ([Block] -> [Block]) -> Pandoc -> Pandoc withPandocBlocks f (Pandoc meta blocks) = Pandoc meta (f blocks) +infixr 5 </> + +a </> b@('/':_) = + error + $ "internal error: unchecked concatenation of absolute path: " + ++ a + ++ " </> " + ++ b +a </> b = (System.FilePath.</>) a b + -- | Get all contents of a directory. (Interned from Hakyll.) getRecursiveContents :: (FilePath -> IO Bool) -- ^ Ignore this file/directory |
