mirror of https://github.com/voidlizard/hbs2
wip, tune deleting
This commit is contained in:
parent
93289b6e58
commit
f8e3d2fdf2
|
@ -482,8 +482,14 @@ runDirectory = do
|
|||
D (p,e) n -> do
|
||||
notice $ "locally deleted file" <+> pretty p
|
||||
|
||||
when (n < Just 2) do
|
||||
-- FIXME: fix-copypaste
|
||||
tombs <- getTombs
|
||||
n <- Compact.get tombs (fromString p)
|
||||
<&> fmap (deserialiseOrFail @Integer . LBS.fromStrict)
|
||||
<&> fmap (either (const Nothing) Just)
|
||||
<&> join
|
||||
|
||||
when (n < Just 2) do
|
||||
postEntryTx refchan path e
|
||||
Compact.put tombs (fromString p) (LBS.toStrict $ serialise $ maybe 0 succ n)
|
||||
|
||||
|
@ -522,6 +528,18 @@ runDirectory = do
|
|||
let fullPath = path </> p
|
||||
here <- liftIO $ doesFileExist fullPath
|
||||
when here do
|
||||
|
||||
tombs <- getTombs
|
||||
postEntryTx refchan path e
|
||||
|
||||
-- FIXME: fix-copypaste
|
||||
n <- Compact.get tombs (fromString p)
|
||||
<&> fmap (deserialiseOrFail @Integer . LBS.fromStrict)
|
||||
<&> fmap (either (const Nothing) Just)
|
||||
<&> join
|
||||
|
||||
Compact.put tombs (fromString p) (LBS.toStrict $ serialise $ maybe 0 succ n)
|
||||
|
||||
notice $ red "tomb entry" <+> pretty (path </> p)
|
||||
rm fullPath
|
||||
|
||||
|
|
Loading…
Reference in New Issue