From 5780eb97239b8b4226f39792db2e967ac6537528 Mon Sep 17 00:00:00 2001 From: Estelle DeBlois Date: Wed, 29 Oct 2014 11:52:24 -0400 Subject: [PATCH] Fix removal of subdirectory during download with deleteRemoved option enabled. * allS3Objects should not contain the directory specified by 'prefix'. Fixes #54 --- lib/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/index.js b/lib/index.js index e6f33c0..bf2889d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1152,6 +1152,9 @@ function syncDir(self, params, directionIsToS3) { ee.objectsFound += data.Contents.length; ee.emit('progress'); data.Contents.forEach(function(object) { + if (object.Key === prefix) { + return; + } object.key = object.Key.substring(prefix.length); allS3Objects.push(object); });