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 is applied to directories, even though docs say it's just applied to files #843

Closed
jedwards1211 opened this issue Oct 29, 2020 · 2 comments · Fixed by #884
Closed

Comments

@jedwards1211
Copy link

Hence I can't use a filter like file => file.endsWith('.js') because that excludes directories that don't end with .js.

The docs only mention files:

filter : Function to filter copied files. Return true to include, false to exclude. Can also return a Promise that resolves to true or false (or pass in an async function).

However when I log what the filter gets called with, it gets called with directories.

@RyanZim
Copy link
Collaborator

RyanZim commented Oct 29, 2020

Ah, yeah; docs aren't well-written here. Calling with directories is intended behavior, but docs should reflect that. PR welcome to clarify docs. Also CC @manidlou

@jedwards1211
Copy link
Author

okay, I'll also make a separate issue about passing isDirectory to the filter, since I'm pretty sure copy already knows that so it would be a waste for the filter function to have to stat the path.

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.

2 participants