At the moment when using copy(), the options.filter() function receives the source path as it's only param. It would be nice to have both the source and destination paths:
fs.copy(srcFolder, destFolder, {
filter: (srcPath, destPath) => {
return true
}
}, cb)
This would make checking last mod dates much easier.
@jprichardson ?
My filters are breaking after upgrade to 2.0.0: This doesn't copy anymore.
var onlyWoff = function (fn) {
return fn.endsWith('.woff');
};
fs.copySync('src/na_components/dist-nwf/theme/fonts', 'dist/na_components/dist-nwf/theme/fonts', { filter: onlyWoff });
I second that; the dest parameter is exactly what I need.
@jprichardson should this be implemented?
@jprichardson should this be implemented?
Yes, seems reasonable to me!
@stephen-last @manidlou Interested in working on this?
@stephen-last if you feel like adding this feature please go ahead and when you are done submit PR, otherwise I will do it.
@manidlou I would love to contribute, however I haven't actually contributed to someone else's code base before, so I'd have to learn how first. I think learning this is probably better done on a smaller project rather than one as important as this one. Feel free to do this one. Thanks!
@stephen-last I am learning too, or I'd better say I never stop learning! :smiley:. I hope you have a wonderful and thriving experience in the journey of educating yourself! Your help is always appreciated here!