diff options
Diffstat (limited to 'Remote')
-rw-r--r-- | Remote/S3.hs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Remote/S3.hs b/Remote/S3.hs index 3265ced78..b3a910639 100644 --- a/Remote/S3.hs +++ b/Remote/S3.hs @@ -71,7 +71,7 @@ genRemote r u c cst = this name = Git.repoDescribe r, storeKey = s3Store this, retrieveKeyFile = s3Retrieve this, - removeKey = error "TODO removekey", + removeKey = s3Remove this, hasKey = s3CheckPresent this, hasKeyCheap = False, config = c @@ -178,3 +178,12 @@ s3Retrieve r k f = s3Action r $ \(conn, bucket) -> do Left e -> do warning $ prettyReqError e return False + +s3Remove :: Remote Annex -> Key -> Annex Bool +s3Remove r k = s3Action r $ \(conn, bucket) -> do + res <- liftIO $ deleteObject conn $ bucketKey bucket k L.empty + case res of + Right _ -> return True + Left e -> do + warning $ prettyReqError e + return False |