diff options
Diffstat (limited to 'Command/AddUrl.hs')
-rw-r--r-- | Command/AddUrl.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs index 169875f4b..a89a25e83 100644 --- a/Command/AddUrl.hs +++ b/Command/AddUrl.hs @@ -356,10 +356,13 @@ cleanup u url file key mtmp = case mtmp of where go = do maybeShowJSON $ JSONChunk [("key", key2file key)] - when (isJust mtmp) $ - logStatus key InfoPresent setUrlPresent u key url - addAnnexedFile file key mtmp + ifM (addAnnexedFile file key mtmp) + ( do + when (isJust mtmp) $ + logStatus key InfoPresent + , liftIO $ maybe noop nukeFile mtmp + ) nodownload :: URLString -> Url.UrlInfo -> FilePath -> Annex (Maybe Key) nodownload url urlinfo file |