ui: support/require fsnotify 0.3.0.1+

The api has changed, it supports directory events, and might be more robust.
This commit is contained in:
Simon Michael 2018-06-05 06:41:13 -07:00
parent bcbf0489c7
commit 236101e31a
7 changed files with 18 additions and 10 deletions

View File

@ -212,7 +212,7 @@ runBrickUi uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} j = do
d d
-- predicate: ignore changes not involving our files -- predicate: ignore changes not involving our files
(\fev -> case fev of (\fev -> case fev of
Modified f _ -> f `elem` files Modified f _ False -> f `elem` files
-- Added f _ -> f `elem` files -- Added f _ -> f `elem` files
-- Removed f _ -> f `elem` files -- Removed f _ -> f `elem` files
-- we don't handle adding/removing journal files right now -- we don't handle adding/removing journal files right now
@ -223,7 +223,7 @@ runBrickUi uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} j = do
-- action: send event to app -- action: send event to app
(\fev -> do (\fev -> do
-- return $ dbglog "fsnotify" $ showFSNEvent fev -- not working -- return $ dbglog "fsnotify" $ showFSNEvent fev -- not working
dbg1IO "fsnotify" $ showFSNEvent fev dbg1IO "fsnotify" $ show fev
writeChan eventChan FileChange writeChan eventChan FileChange
) )
@ -234,7 +234,3 @@ runBrickUi uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} j = do
let myVty = mkVty def let myVty = mkVty def
#endif #endif
void $ customMain myVty (Just eventChan) brickapp ui void $ customMain myVty (Just eventChan) brickapp ui
showFSNEvent (Added f _) = "Added " ++ show f
showFSNEvent (Modified f _) = "Modified " ++ show f
showFSNEvent (Removed f _) = "Removed " ++ show f

View File

@ -2,7 +2,7 @@
-- --
-- see: https://github.com/sol/hpack -- see: https://github.com/sol/hpack
-- --
-- hash: 76f2079643447fd282a8fb455594f8801e1a011cae69d7d1ec6bc3180dcf583f -- hash: 82e8763ca935ff359245f2b359e094fe863143d27e58a2d90b0ddb1e3d7c272e
name: hledger-ui name: hledger-ui
version: 1.9.99 version: 1.9.99
@ -75,7 +75,7 @@ executable hledger-ui
, data-default , data-default
, directory , directory
, filepath , filepath
, fsnotify >=0.2 , fsnotify >=0.3.0.1
, hledger >=1.9.99 && <2.0 , hledger >=1.9.99 && <2.0
, hledger-lib >=1.9.99 && <2.0 , hledger-lib >=1.9.99 && <2.0
, megaparsec >=6.4.1 , megaparsec >=6.4.1

View File

@ -51,7 +51,7 @@ dependencies:
- data-default - data-default
- directory - directory
- filepath - filepath
- fsnotify >=0.2 - fsnotify >=0.3.0.1
- HUnit - HUnit
- microlens >=0.4 - microlens >=0.4
- microlens-platform >=0.2.3.1 - microlens-platform >=0.2.3.1

View File

@ -85,3 +85,8 @@ extra-deps:
# - th-orphans-0.13.4 # - th-orphans-0.13.4
# - vty-5.17.1 # - vty-5.17.1
# - word-wrap-0.4.1 # - word-wrap-0.4.1
# hledger-ui
# newer fsnotify has a different api and may be more robust
- fsnotify-0.3.0.1
- shelly-1.7.2

View File

@ -46,3 +46,6 @@ extra-deps:
- hashtables-1.2.3.1 - hashtables-1.2.3.1
# avoid hanging with windows symlinks https://github.com/simonmichael/hledger/issues/791 # avoid hanging with windows symlinks https://github.com/simonmichael/hledger/issues/791
- directory-1.3.2.2 - directory-1.3.2.2
# hledger-ui
# newer fsnotify has a different api and may be more robust
- fsnotify-0.3.0.1

View File

@ -21,6 +21,9 @@ extra-deps:
- hashtables-1.2.3.1 - hashtables-1.2.3.1
# avoid https://github.com/simonmichael/hledger/issues/791 # avoid https://github.com/simonmichael/hledger/issues/791
- directory-1.3.2.2 - directory-1.3.2.2
# hledger-ui
# newer fsnotify has a different api and may be more robust
- fsnotify-0.3.0.1
nix: nix:
pure: false pure: false

View File

@ -13,7 +13,8 @@ extra-deps:
# hledger-lib # hledger-lib
- easytest-0.1.1 - easytest-0.1.1
# hledger-ui # hledger-ui
- fsnotify-0.2.1.2 # newer fsnotify has a different api and may be more robust
- fsnotify-0.3.0.1
# hledger-web # hledger-web
- json-0.9.2 - json-0.9.2
- wai-handler-launch-3.0.2.4 - wai-handler-launch-3.0.2.4