This repository was archived by the owner on Feb 12, 2021. It is now read-only.
Download with deleteRemoved option should not delete subdirectory #57
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #54
To sum it up, when you try to download a remote directory called
remote-dirfrom a bucket, and specify the local directory aslocal-dir, I would expect just the contents ofremote-dirto download, not the directory itself, soremote-dir/shouldn't need to be pushed toallS3Objectswhen listing remote objects, but it is right now.If
local-dirhas a subdirectory calledfoo(valid directory that also exists remotely and thus should be retained), it will get deleted on the next download attempt. Because of the extraremote-dir/entry inallS3Objects, when you start diff'ing the remote objects against the local ones, you end up checking if the stringfoo/is contained within theremote-dir/s3Object.key string, which is an empty string after the prefix truncation. And since it isn't,deleteLocalDir()gets called.