on master help sign in
Fix issue with ignoreFile
commit86cdd0327fc937997a407c1ccbd73bd107d7d38e authorJasper Van der Jeugt <jaspervdj@gmail.com> dateMon 16 May 2011, 23:09 (15 years ago) parent8c0335c
2 files changed+14−1
src/Hakyll/Core/Configuration.hs+13 src/Hakyll/Core/Resource/Provider/File.hs+1−1
src/Hakyll/Core/Configuration.hs+13
@@ -2,6 +2,7 @@
22--
33module Hakyll.Core.Configuration
44 ( HakyllConfiguration (..)
5+ , shouldIgnoreFile
56 , defaultHakyllConfiguration
67 ) where
78
@@ -23,6 +24,10 @@ data HakyllConfiguration = HakyllConfiguration
2324 --
2425 -- * files ending with @.swp@
2526 --
27+ -- Note that the files in @destinationDirectory@ and @storeDirectory@ will
28+ -- also be ignored. Note that this is the configuration parameter, if you
29+ -- want to use the test, you should use @shouldIgnoreFile@.
30+ --
2631 ignoreFile :: FilePath -> Bool
2732 }
2833
@@ -42,3 +47,11 @@ defaultHakyllConfiguration = HakyllConfiguration
4247 | otherwise = False
4348 where
4449 fileName = takeFileName path
50+
51+-- | Check if a file should be ignored
52+--
53+shouldIgnoreFile :: HakyllConfiguration -> FilePath -> Bool
54+shouldIgnoreFile conf path =
55+ destinationDirectory conf `isPrefixOf` path ||
56+ storeDirectory conf `isPrefixOf` path ||
57+ ignoreFile conf path
src/Hakyll/Core/Resource/Provider/File.hs+1−1
@@ -18,7 +18,7 @@ import Hakyll.Core.Configuration
1818fileResourceProvider :: HakyllConfiguration -> IO ResourceProvider
1919fileResourceProvider configuration = do
2020 -- Retrieve a list of paths
21− list <- map Resource . filter (not . ignoreFile configuration) <$>
21+ list <- map Resource . filter (not . shouldIgnoreFile configuration) <$>
2222 getRecursiveContents False "."
2323 makeResourceProvider list (readFile . unResource)
2424 (LB.readFile . unResource)