Closed matthew-dean closed 1 year ago
oh wait! I got it working with:
"clean": "shx rm -rf \"**/node_modules/\" \"**/package-lock.json\""
Huh, that's strange. I get the same behavior with double quotes or single quotes. I'm testing this on Ubuntu with npm 8.5.1 and nodejs v12.22.9:
"scripts": {
"testquote": "shx ls 'node_modules/**/index.js'",
"testdoublequote": "shx ls \"node_modules/**/index.js\""
},
I also noticed you changed that from 2 rm
commands to use just 1 rm
command with 2 arguments. I think either should work, but maybe there's some race condition I'm not thinking about with the two commands.
I should add: I think Windows does not honor single quotes (it treats them like they're part of the file name). So if you want this to be cross platform, then I recommend you use double quotes (exactly like you did in your last update).
I'm trying to run this NPM script:
However, this seems to exit without recursively removing those directories / files.