replace removeLink with removeFile

removeFile calls unlink so removes anything not a directory. So these
are replaceable in order to convert to OsPath.
This commit is contained in:
Joey Hess 2025-02-02 14:16:58 -04:00
parent 8af91a4c92
commit 5cc8d9d03b
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
9 changed files with 39 additions and 41 deletions

View file

@ -420,10 +420,10 @@ writeRetrievedContent dest enc encc mh mp content miv = case (enc, mh, content)
withBytes content $ \b ->
decrypt cmd encc cipher (feedBytes b) $
readBytes write
liftIO $ removeWhenExistsWith R.removeLink (fromOsPath f)
liftIO $ removeWhenExistsWith removeFile f
(Nothing, _, FileContent f) -> do
withBytes content write
liftIO $ removeWhenExistsWith R.removeLink (fromOsPath f)
liftIO $ removeWhenExistsWith removeFile f
(Nothing, _, ByteContent b) -> write b
where
write b = case mh of