jonschlinkert / copy

Copy files using glob patterns. Sync, async, promise or streams. (node.js utility)
MIT License
94 stars 125 forks source link

Breaks in Node 10.x #28

Closed rijkvanzanten closed 6 years ago

rijkvanzanten commented 6 years ago

When using Node 10, the plugin creates new files in the right place, but doesn't copy over the file contents

doowb commented 6 years ago

@rijkvanzanten can you post the code used to reproduce this and which operating system you're using?

rijkvanzanten commented 6 years ago

I'm using an NPM script called copy:

copy \"./{interfaces,pages,listings}/**/meta.json\" dist which copies over all meta.json files from those three folders into dist (while keeping the directory structure intact.

I'm using macOS High Sierra 10.13.3

doowb commented 6 years ago

I'm able to verify that something changed between node v9.11.1 and v10.0.0 but I haven't dug in to figure out the difference yet.

Elephant-Vessel commented 6 years ago

Same here, using win 7.

tmcw commented 6 years ago

Looks like the same issue as in cp-file: here's the PR that fixed that project https://github.com/sindresorhus/cp-file/pull/26 - the gist is that you'll need to switch from .on('readable' to .once('readable'.

doowb commented 6 years ago

Thanks @tmcw!

doowb commented 6 years ago

Published a bug fix as patch 0.3.2. I checked different versions of node before publishing (and travis will also do the check) and everything works back to node@0.10.0.