on master help sign in
Bump tasty to 1.1, fsnotify to 0.3
commit8be1aa564a46974b5c4c3efd13cd8b9c83a1a0f3 authorJasper Van der Jeugt <m@jaspervdj.be> dateTue 29 May 2018, 21:54 (8 years ago) parent8074252
3 files changed+14−22
hakyll.cabal+3−3 lib/Hakyll/Preview/Poll.hs+8−18 stack.yaml+3−1
hakyll.cabal+3−3
@@ -197,7 +197,7 @@ Library
197197 warp >= 3.2 && < 3.3,
198198 wai-app-static >= 3.1 && < 3.2,
199199 http-types >= 0.9 && < 0.13,
200− fsnotify >= 0.2 && < 0.3
200+ fsnotify >= 0.2 && < 0.4
201201 Cpp-options:
202202 -DPREVIEW_SERVER
203203 Other-modules:
@@ -206,7 +206,7 @@ Library
206206
207207 If flag(watchServer)
208208 Build-depends:
209− fsnotify >= 0.2 && < 0.3
209+ fsnotify >= 0.2 && < 0.4
210210 Cpp-options:
211211 -DWATCH_SERVER
212212 Other-modules:
@@ -260,7 +260,7 @@ Test-suite hakyll-tests
260260 Build-Depends:
261261 hakyll,
262262 QuickCheck >= 2.8 && < 2.12,
263− tasty >= 0.11 && < 1.1,
263+ tasty >= 0.11 && < 1.2,
264264 tasty-hunit >= 0.9 && < 0.11,
265265 tasty-quickcheck >= 0.8 && < 0.11,
266266 -- Copy pasted from hakyll dependencies:
lib/Hakyll/Preview/Poll.hs+8−18
@@ -14,8 +14,7 @@ import Control.Exception (AsyncException, fromException,
1414import Control.Monad (forever, void, when)
1515import System.Directory (canonicalizePath)
1616import System.FilePath (pathSeparators)
17−import System.FSNotify (Event (..), startManager,
18− watchTree)
17+import qualified System.FSNotify as FSNotify
1918
2019#ifdef mingw32_HOST_OS
2120import Control.Concurrent (threadDelay)
@@ -44,12 +43,12 @@ watchUpdates conf update = do
4443 shouldBuild <- newEmptyMVar
4544 pattern <- update
4645 fullProviderDir <- canonicalizePath $ providerDirectory conf
47− manager <- startManager
46+ manager <- FSNotify.startManager
4847
4948 let allowed event = do
5049 -- Absolute path of the changed file. This must be inside provider
5150 -- dir, since that's the only dir we're watching.
52− let path = eventPath event
51+ let path = FSNotify.eventPath event
5352 relative = dropWhile (`elem` pathSeparators) $
5453 drop (length fullProviderDir) path
5554 identifier = fromFilePath relative
@@ -69,7 +68,7 @@ watchUpdates conf update = do
6968
7069 -- Send an event whenever something occurs so that the thread described
7170 -- above will do a build.
72− void $ watchTree manager providerDir (not . isRemove) $ \event -> do
71+ void $ FSNotify.watchTree manager providerDir (not . isRemove) $ \event -> do
7372 allowed' <- allowed event
7473 when allowed' $ void $ tryPutMVar shouldBuild event
7574 where
@@ -77,7 +76,7 @@ watchUpdates conf update = do
7776 update' _ _ = void update
7877#else
7978 update' event provider = do
80− let path = provider </> eventPath event
79+ let path = provider </> FSNotify.eventPath event
8180 -- on windows, a 'Modified' event is also sent on file deletion
8281 fileExists <- doesFileExist path
8382
@@ -105,15 +104,6 @@ watchUpdates conf update = do
105104
106105
107106--------------------------------------------------------------------------------
108−eventPath :: Event -> FilePath
109−eventPath evt = evtPath evt
110− where
111− evtPath (Added p _) = p
112− evtPath (Modified p _) = p
113− evtPath (Removed p _) = p
114−
115−
116−--------------------------------------------------------------------------------
117−isRemove :: Event -> Bool
118−isRemove (Removed _ _) = True
119−isRemove _ = False
107+isRemove :: FSNotify.Event -> Bool
108+isRemove (FSNotify.Removed {}) = True
109+isRemove _ = False
stack.yaml+3−1
@@ -1,4 +1,4 @@
1−resolver: lts-11.5
1+resolver: lts-11.7
22extra-package-dbs: []
33
44flags:
@@ -26,3 +26,5 @@ extra-deps:
2626- 'pandoc-2.2'
2727- 'pandoc-types-1.17.4.2'
2828- 'pandoc-citeproc-0.14.3.1'
29+- 'tasty-1.1.0.1'
30+- 'fsnotify-0.3.0.0'