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
|
D (p,e) n -> do
|
||||||
notice $ "locally deleted file" <+> pretty p
|
notice $ "locally deleted file" <+> pretty p
|
||||||
|
|
||||||
|
-- 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
|
when (n < Just 2) do
|
||||||
tombs <- getTombs
|
|
||||||
postEntryTx refchan path e
|
postEntryTx refchan path e
|
||||||
Compact.put tombs (fromString p) (LBS.toStrict $ serialise $ maybe 0 succ n)
|
Compact.put tombs (fromString p) (LBS.toStrict $ serialise $ maybe 0 succ n)
|
||||||
|
|
||||||
|
@ -522,6 +528,18 @@ runDirectory = do
|
||||||
let fullPath = path </> p
|
let fullPath = path </> p
|
||||||
here <- liftIO $ doesFileExist fullPath
|
here <- liftIO $ doesFileExist fullPath
|
||||||
when here do
|
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)
|
notice $ red "tomb entry" <+> pretty (path </> p)
|
||||||
rm fullPath
|
rm fullPath
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue