1{-# OPTIONS_GHC -Wall #-}
2module File.Watcher where
4import Control.Concurrent (forkIO, threadDelay)
5import Control.Concurrent.Chan (newChan, readChan, writeChan)
6import qualified System.FSNotify as Notify
8import qualified Elm.Project as Project
9import Elm.Project (Project)
18 { _elm :: Map.Map Module.Raw Node
19 , _js :: Map.Map Module.Raw FilePath
27 , _needs :: Set.Set Module.Raw
28 , _blocks :: Set.Set Module.Raw
29 , _iface :: Maybe (UTCTime, Interface)
37action :: Notify.Event -> IO ()
40 Notify.Added path time ->
43 Notify.Modified path time ->
46 Notify.Removed path time ->
50watcher :: Project -> IO ()
54 Project.toSourceDir project
61 Notify.Modified path time ->
63 Notify.Removed path time ->
67 mapM_ (watcherHelp killer action) [srcDir]
71watcherHelp :: Notify.Action -> FilePath -> IO ()
72watcherHelp killer action dir =
73 void $ forkIO $ Notify.withManager $ \manager ->
74 do stop <- Notify.watchTree manager dir (const True) action
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list