also re-extract if file modified

This commit is contained in:
Keagan McClelland
2021-09-29 13:22:39 -06:00
parent aa3e9f3129
commit 765bf7c7b5

View File

@@ -76,7 +76,8 @@ import Startlude ( ($)
, throwIO
, void
)
import System.FSNotify ( Event(Added)
import System.FSNotify ( ActionPredicate
, Event(..)
, eventPath
, watchTree
, withManager
@@ -189,9 +190,11 @@ watchPkgRepoRoot = do
stop
pure $ tryPutMVar box ()
where
onlyAdded = \case
Added path _ isDir -> not isDir && takeExtension path == ".s9pk"
_ -> False
onlyAdded :: ActionPredicate
onlyAdded (Added path _ isDir) = not isDir && takeExtension path == ".s9pk"
onlyAdded (Modified path _ isDir) = not isDir && takeExtension path == ".s9pk"
onlyAdded _ = False
-- Added path _ isDir -> not isDir && takeExtension path == ".s9pk"
getManifest :: (MonadResource m, MonadReader r m, Has PkgRepo r)
=> PkgId