Skip to content

Commit

Permalink
minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
freyo committed Feb 28, 2019
1 parent 44ba7f6 commit 0291bb1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Adapter.php
Expand Up @@ -273,11 +273,15 @@ public function deleteDir($dirname)

$keys = array_map(function ($item) {
return ['Key' => $item['Key']];
}, (array) $response['Contents']);
}, (array)$response['Contents']);

$keys = array_filter($keys, function ($item) {
return substr($item['Key'], -1) !== '/';
});

return (bool) $this->client->deleteObjects([
'Bucket' => $this->getBucket(),
'Key' => $keys,
'Bucket' => $this->getBucket(),
'Key' => $keys,
]);
}

Expand Down

0 comments on commit 0291bb1

Please sign in to comment.