Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy filter called twice #809

Closed
ozum opened this issue Jun 8, 2020 · 0 comments
Closed

copy filter called twice #809

ozum opened this issue Jun 8, 2020 · 0 comments
Assignees
Milestone

Comments

@ozum
Copy link

@ozum ozum commented Jun 8, 2020

  • Operating System: MacOS 10.14.6
  • Node.js version: 14.1.0
  • fs-extra version: 9.0.1

Hi,

Copy filter function called twice for same source and destination. I found a similar report for emptyDir, but couldn't see a case for copy.

Is this expected for some reason?

Example:

// Below code outputs: 1 2, whereas I expected only 1.
const { copy } = require("fs-extra");

let i = 1;

copy("README.md", "README2.md", {
  filter: () => {
    console.log(i++);
    return true;
  },
});
@RyanZim RyanZim assigned RyanZim and unassigned manidlou Apr 2, 2021
@RyanZim RyanZim added the bug label Apr 2, 2021
@RyanZim RyanZim added this to the 10.0.0 milestone Apr 2, 2021
RyanZim added a commit that referenced this issue Apr 2, 2021
@RyanZim RyanZim closed this in #883 Apr 16, 2021
RyanZim added a commit that referenced this issue Apr 16, 2021
Fixes #809
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants