shelljs / shx

Portable Shell Commands for Node
MIT License
1.72k stars 44 forks source link

cp -r fails after 72 directories (Many files) #94

Closed McPo closed 7 years ago

McPo commented 7 years ago

Im attempting to copy node_modules to a build directory for packaging into an electron application.

It appears that shx silently fails after 72 items. I checked to make sure it wasn't hiccuping on the last directory it copied 'history', by deleting 'history'. The next alphabetical directory was then copied but no more. ie I think theres a limit on the number of items that can be copied.

shx mkdir ./build/node_modules && shx cp -r ./src/node_modules/* ./build/node_modules

works fine, but

shx cp -r ./src/node_modules ./build/node_modules

does not, while

cp -r ./src/node_modules ./build/node_modules

works as expected.

Ive tried verbose logging, but it just reprints the command. Could it have anything to do with the ulimit being reached on the device as I know I had issues with that and webpack. The solution was to make webpack only process so many files at a time, as the ulimit couldn't be increased.

Im on OSX.

nfischer commented 7 years ago

Can you provide a directory structure this repros for? I can't repro on my Linux machine. Thanks

McPo commented 7 years ago

Heres my node_modules directory

https://drive.google.com/file/d/0B3Hzs-LoXgdkUDl3NmVJVmxOSDQ/view?usp=sharing

Then to reproduce the issue:

shx cp -r ./node_modules ./node_modules2

Not all files will be copied.

nfischer commented 7 years ago

Confirmed. This is a bug upstream at ShellJS. Closing this here and refiling as shelljs/shelljs#547