I want both the Endpoints and Operations directories (and any other that might be there in the future) copied over to the target location. I want to filter out Meta.json though. Like so.
What happens is that the filter only fires for the directory itself. Not for each of the entries in it. So the filtering doesn't work as expected.
P.S: Note that if instead I try to use fs.readdir to get the entries in the directory, filter Meta.json and then copy on each entry in the Foo directory, I end up with:
I'm trying to copy the contents of a folder whose structure is this:
I want both the
Endpoints
andOperations
directories (and any other that might be there in the future) copied over to the target location. I want to filter outMeta.json
though. Like so.Now, if I use
What happens is that the filter only fires for the directory itself. Not for each of the entries in it. So the filtering doesn't work as expected.
P.S: Note that if instead I try to use
fs.readdir
to get the entries in the directory, filterMeta.json
and thencopy
on each entry in theFoo
directory, I end up with:Which does not preserve the folder structure. So this is not a suitable workaround.