]> woffs.de Git - fd/haskell-amqp-utils.git/commitdiff
agitprop: ignore hidden files
authorFrank Doepper <[email protected]>
Tue, 26 Jun 2018 07:08:53 +0000 (09:08 +0200)
committerFrank Doepper <[email protected]>
Tue, 26 Jun 2018 07:08:53 +0000 (09:08 +0200)
agitprop.hs

index 6bfc3ab617f434ab38828150fdfba946c07d1437..36ac4cb310114a339dc05dffbea891d6301b9525 100644 (file)
@@ -81,6 +81,11 @@ confirmCallback (deliveryTag, isAll, ackType) =
 
 -- | hotfolder event handler
 handleEvent :: (BL.ByteString -> IO ()) -> Event -> IO ()
-handleEvent f (Closed False (Just x) True) = hr x >> BL.readFile x >>= f
-handleEvent f (MovedIn False x _) = hr x >> BL.readFile x >>= f
+handleEvent f (Closed False (Just x) True) = handleFile f x
+handleEvent f (MovedIn False x _) = handleFile f x
 handleEvent _ _ = return ()
+
+-- | hotfolder file handler
+handleFile :: (BL.ByteString -> IO ()) -> FilePath -> IO ()
+handleFile _ ('.':_) = return ()
+handleFile f x = hr x >> BL.readFile x >>= f