add gitAnnexTmpWorkDir and withTmpWorkDir
Needed to run youtube-dl in, but could also be useful for other stuff. The tricky part of this was making the workdir be cleaned up whenever the tmp object file is cleaned up. This commit was sponsored by Ole-Morten Duesund on Patreon.
This commit is contained in:
parent
3febb79c8f
commit
4e7e1fcff4
4 changed files with 59 additions and 8 deletions
|
@ -55,5 +55,5 @@ perform from numcopies key = case from of
|
|||
performOther :: (Key -> Git.Repo -> FilePath) -> Key -> CommandPerform
|
||||
performOther filespec key = do
|
||||
f <- fromRepo $ filespec key
|
||||
liftIO $ nukeFile f
|
||||
pruneTmpWorkDirBefore f (liftIO . nukeFile)
|
||||
next $ return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue