question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

why shut my copy task when i wanna to copy a dir with use filter function

See original GitHub issue

https://github.com/jprichardson/node-fs-extra/blob/a0d44c1773a72870ecfa1ff378b80a388fb445ef/lib/copy/copy.js#L59-L65

example:

fs.copy(srcDir, destDir, {
  filter: () => {
    console.log('run filter')
    return false
  },
}, (err) => {
  if (err) return console.error(err);

  console.log('success!');
});

shut down in first file copy!

i have no idea why about use cb() when run handleFilter . maybe i just wanna copy a dir and hope to filter some file which i dont want to copy
is this a reasonable design?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
RyanZimcommented, Feb 26, 2018

You’re consistently returning false from your filter, which indicates you don’t want to copy anything, so fs-extra just stops.

0reactions
RyanZimcommented, Apr 6, 2018

Fixed in https://github.com/jprichardson/node-fs-extra/pull/554, will be in the next release later this month.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FastCopy Help (en)
Filter Options. It can Include/Exclude the copy target files/directories that match/unmatch by filters. Select the "listing" button to confirm ...
Read more >
Copy Task - MSBuild | Microsoft Learn
Learn how to use the MSBuild Copy task to copy files to a new file or folder location in the file system.
Read more >
Filtered Operations - Directory Opus
Copy Files: When copying or moving files, filtering is enabled by selecting the Copy Filter option in the drop-down attached to the Copy...
Read more >
Level up with these advanced PowerShell commands to copy ...
For example, the command below only copies files with a 6 in the filename. Combine the Path, Filter, Include or Exclude parameters to...
Read more >
1. File Operations - Gradle Beyond the Basics [Book] - O'Reilly
At execution, a copy task copies files into a destination directory from one ... The expand() and filter() methods apply the same transformation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found