diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-11-29 13:49:52 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-11-29 13:53:39 -0400 |
commit | b7178922644c813a2cb69c185ca751aa234fa05b (patch) | |
tree | 770900f2dbdd269c5224eaf30ad42f0083732697 /Remote/Helper/Special.hs | |
parent | 8c07e4dbf7d5145ed6412278c4288e3c405484ed (diff) |
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.
Diffstat (limited to 'Remote/Helper/Special.hs')
-rw-r--r-- | Remote/Helper/Special.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Remote/Helper/Special.hs b/Remote/Helper/Special.hs index f7e9759a4..83e08c5aa 100644 --- a/Remote/Helper/Special.hs +++ b/Remote/Helper/Special.hs @@ -107,7 +107,7 @@ fileRetriever :: (FilePath -> Key -> MeterUpdate -> Annex ()) -> Retriever fileRetriever a k m callback = do f <- prepTmp k a f k m - callback (FileContent f) + pruneTmpWorkDirBefore f (callback . FileContent) -- A Retriever that generates a lazy ByteString containing the Key's -- content, and passes it to a callback action which will fully consume it |