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 · Fixed by #883
Closed

copy filter called twice #809

ozum opened this issue Jun 8, 2020 · 0 comments · Fixed by #883
Assignees
Milestone

Comments

@ozum
Copy link

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;
  },
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants