on master help sign in
Use shouldIgnoreFile
commit7677bb4a775f7e0f6d1d88a5c0d37d5eb30d0213 authorSimonas Kazlauskas <git@kazlauskas.me> dateSat 30 Mar 2013, 18:07 (14 years ago) parentfdfbf3d
1 file changed+6−8
src/Hakyll/Preview/Poll.hs+6−8
src/Hakyll/Preview/Poll.hs+6−8
@@ -21,21 +21,19 @@ import Hakyll.Core.Configuration
2121previewPoll :: Configuration -- ^ Configuration
2222 -> IO [FilePath] -- ^ Updating action
2323 -> IO () -- ^ Can block forever
24−previewPoll conf update = monitor =<< startManagerConf (Debounce 0.1)
24+previewPoll conf update = do
25+ _ <- update
26+ manager <- startManagerConf (Debounce 0.1)
27+ ignore <- mapM getPath [destinationDirectory, storeDirectory, tmpDirectory]
28+ watchTree manager path (predicate ignore) (\_ -> void update)
2529 where
2630 path = decodeString $ providerDirectory conf
27− monitor manager = do
28− _ <- update
29− ignore <- mapM getPath
30− [destinationDirectory, storeDirectory, tmpDirectory]
31− watchTree manager path (predicate ignore) (\_ -> void update)
3231 getPath fn = catchIOError (canonicalizePath $ fn conf)
3332 (const $ return $ fn conf)
3433 predicate ignore evt
3534 | isRemove evt = False
3635 | any (flip isPrefixOf $ eventPath evt) ignore == True = False
37− | (ignoreFile conf) (eventPath evt) == True = False
38− | otherwise = True
36+ | otherwise = not $ shouldIgnoreFile conf (eventPath evt)
3937
4038eventPath :: Event -> FilePath
4139eventPath (Added p _) = encodeString p