Skip to content
This repository was archived by the owner on Feb 12, 2021. It is now read-only.
This repository was archived by the owner on Feb 12, 2021. It is now read-only.

deleteRemoved option with downloadDir causes some local directories to disappear entirely #54

@brzpegasus

Description

@brzpegasus

I'm trying to download the content of an entire directory from an S3 bucket. The directory contains two subdirectories, which themselves contain a bunch of files. It essentially looks something like this:

+ some-bucket-name
  |_ test/
      |_ foo/
      |_ bar/

The first time that I call downloadDir() with the deleteRemoved flag set to true, both subdirectories (foo and bar in this example) download to a local directory as expected:

target-dir/
|_ foo/
|_ bar/

However, on each subsequent downloadDir() call, something weird happens: the local target-dir ends up with only one directory left. Sometimes, it's foo, and sometimes, it's bar.

The code for the download is pretty straightforward:

var downloader = client.downloadDir({
  localDir: "target-dir",
  s3Params: {
    Bucket: "some-bucket-name",
    Prefix: "test/"
  },
  deleteRemoved: true
});

I haven't been able to dig into this project's code yet, but is there something that might immediately come to mind?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions