AvianFlu / ncp

Asynchronous recursive file copying with Node.js.
MIT License
680 stars 103 forks source link

Filter mixes path separators on Windows #57

Closed whitlockjc closed 9 years ago

whitlockjc commented 9 years ago

I recently ran into an issue on a127 where the filter callback used to filter out paths not to copy was not matching. When I did a little debugging, I noticed that ncp was passing in a file name with both \ and / in it. Basically, the / started at the copy root path. So if I started copying from C:\Users\Jeremy Whitlock\Projects\a127, all path segments after C:\Users\Jeremy Whitlock\Projects\a127 used / for path separators. For example, when ncp called the filter for the C:\Users\Jeremy Whitlock\Projects\a127\package.json file, the file name passed to the filter is C:\Users\Jeremy Whitlock\Projects\a127/package.json.

kylepaulsen commented 9 years ago

I second this. It looks like path.join isn't being used on https://github.com/AvianFlu/ncp/blob/e9e6fae157e94e6c55b8edae70779bf12b0d2476/lib/ncp.js#L176

mmalecki commented 9 years ago

Fixed, thanks for reporting!