-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
Arguments in quotes not handled correctly #354
Comments
Quoting is shell-specific. Instead you have three options:
|
Thanks for the fast response to this issue. |
You contradict yourself. console.log(process.argv.slice(2)) Then execute the
Yes, it does work in BASH, but not in Batch. The only case where is not desirable to use the 2nd way is when you use What did you mean by that:
BASH has double-quotes, Batch has double-quotes, PowerShell has double-quotes. The only difference is escaping and variable substitution. The first one is solved by JS' escaping. The second one solved by either using interpolated strings ( So, is double-quoting really some kind of "non-cross-platform code"? Why can't this feature just be implemented? I really see no way to make some bad code out of double-quoting. |
The command execa.command does not handle arguments in quotes correctly. It splits all strings by space and ignores arguments in quotes.
What happend
To test this I have this script
That I run like this and it splits argument 2 ('arg 2') into 2 arguments.
What I expected
I expected argument 2 ('arg 2') not to be split into 2 arguments.
Maybe something similar to shell-parsercould be used instead of the "SPACES_REGEXP" string split
The text was updated successfully, but these errors were encountered: