-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean command fails in path with spaces #181
Comments
Actually testing this more, it seems |
Thanks for the bug report - I assume if we pass the arguments as a separate array instead of hardcoding them into the command to be executed, Node should handle escaping them properly. Will give it a go soon. |
I have faced this issue today and I did some debugging, it turns out "for me" that |
Rimraf handles spaces just fine. The bug here is that you're passing a string to exec, you're not calling spawn with an array of arguments. Consider if you had a file called In Node.js, if you call But if you call You should really almost never be passing strings from userland or the filesystem directly into a command like this. It's almost always a security vulnerability. For example, I could publish a module with a file named rm some-file
do-something-evil and then evil things would happen and I'd have control of your machine. Since rimraf can be used as a module, and this script is in JavaScript, there's no need to execSync it. Just require() it and use the function. |
Use rimraf as a function, fixes #181 Includes a bit of refactoring to reduce duplicated spinner management
Use rimraf as a function, fixes #181 Includes a bit of refactoring to reduce duplicated spinner management
Seems to be due to the space in the path. I checked out the source code at https://github.com/insin/nwb/blob/master/src/commands/clean-app.js and couldn’t see an easy fix.
Is it possibly line 10 here needs quotes for the args (although each arg would have to be quoted I think)?
nwb/src/exec.js
Line 10 in 85af7f4
->
Or perhaps in
nwb/src/commands/clean-app.js
Line 6 in 85af7f4
->
The text was updated successfully, but these errors were encountered: