diff options
Diffstat (limited to 'Command/Add.hs')
-rw-r--r-- | Command/Add.hs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Command/Add.hs b/Command/Add.hs index 7fbfa6e7f..d83817d72 100644 --- a/Command/Add.hs +++ b/Command/Add.hs @@ -57,13 +57,10 @@ lockDown file = do createAnnexDirectory tmp pid <- liftIO getProcessID let tmpfile = tmp </> "add" ++ show pid ++ "." ++ takeFileName file - nuke tmpfile + liftIO $ nukeFile tmpfile liftIO $ createLink file tmpfile return tmpfile -nuke :: FilePath -> Annex () -nuke file = liftIO $ whenM (doesFileExist file) $ removeFile file - {- Moves the file into the annex. -} ingest :: FilePath -> Annex (Maybe Key) ingest file = do @@ -75,7 +72,7 @@ ingest file = do go _ Nothing = return Nothing go tmpfile (Just (key, _)) = do handle (undo file key) $ moveAnnex key tmpfile - nuke file + liftIO $ nukeFile file return $ Just key perform :: FilePath -> CommandPerform @@ -86,7 +83,7 @@ perform file = maybe stop (\key -> next $ cleanup file key True) =<< ingest file undo :: FilePath -> Key -> IOException -> Annex a undo file key e = do whenM (inAnnex key) $ do - nuke file + liftIO $ nukeFile file handle tryharder $ fromAnnex key file logStatus key InfoMissing throw e |