Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Some additional functions on top of System.FSNotify.
Example of compiling scss files with compass
compass :: WatchManager -> FilePath -> m ()
compass man dir = do
putStrLn $ "compass " ++ encodeString dir
treeExtExists man dir "scss" $ fp ->
when ("deploy" notElem
splitDirectories fp) $ do
let d = encodeString $ head (splitDirectories rel)
system "cd " ++ d ++ "&& bundle exec compass compile"
return ()
Synopsis
- treeExtAny :: WatchManager -> FilePath -> Text -> (FilePath -> IO ()) -> IO StopListening
- treeExtExists :: WatchManager -> FilePath -> Text -> (FilePath -> IO ()) -> IO StopListening
- doAllEvents :: Monad m => (FilePath -> m ()) -> Event -> m ()
- allEvents :: (FilePath -> Bool) -> Event -> Bool
- existsEvents :: (FilePath -> Bool) -> Event -> Bool
Documentation
:: WatchManager | |
-> FilePath | Directory to watch |
-> Text | extension |
-> (FilePath -> IO ()) | action to run on file |
-> IO StopListening |
In the given directory tree, watch for any events for files with the given file extension
:: WatchManager | |
-> FilePath | Directory to watch |
-> Text | extension |
-> (FilePath -> IO ()) | action to run on file |
-> IO StopListening |