factor observe_
This commit is contained in:
parent
5cd44282a9
commit
fc80b8d96b
3 changed files with 10 additions and 13 deletions
|
@ -172,9 +172,7 @@ withRsyncScratchDir a = do
|
|||
let tmp = t </> "rsynctmp" </> show pid
|
||||
nuke tmp
|
||||
liftIO $ createDirectoryIfMissing True tmp
|
||||
res <- a tmp
|
||||
nuke tmp
|
||||
return res
|
||||
observe_ (nuke tmp) (a tmp)
|
||||
where
|
||||
nuke d = liftIO $
|
||||
doesDirectoryExist d >>? removeDirectoryRecursive d
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue