-
Notifications
You must be signed in to change notification settings - Fork 13
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
Windows doesn't like single quotes #9
Comments
This lib is unfortunately not compatible at all with the Windows shell. |
As there appears to be no interest in the pull requests, I'd like to note that others might be interested in using The reason one might want to use |
As just mentionned in my comment on the PR, this lib is not ready to support Windows shell. In fact it support the most common linux shells (only): sh, bash, zsh. Adding support for other shells (cmd.exe, powershell...etc) needs to define others functions or options to let the user set for what shell he want to escape. I'm open to it, but it will be much more complicated. |
@xxorax May you at least update the README to indicate that this project is intended only for systems with POSIX shells and does not support Windows for now? |
can you please update the readme this so that it states which OS it's compatible for (so others don't waste time) |
As yet another person that just wasted time on this repo since I need to support Windows, I will echo what the others have asked for 😄 |
I've made an updated fork using @seangenabe's code https://github.com/mkg20001/escape-it Tests are currently broken for windows, since I don't know what the intended behavior is (it doesn't seem to escape ';') Also, the api changed. Now it is Platform is assumed to be process.platform by default |
@mkg20001 see @seangenabe branch win32-tests https://github.com/seangenabe/node-shell-escape/tree/win32-tests |
@mkg20001 @xmedeko Please use cross-spawn instead of escaping parameters and interpolating shellouts yourselves. That style of executing programs is only asking for trouble/security issues/weird-hard-to-debug-brokenness. |
@binki I am well aware that the |
POSIX-only solution, incompatible with Windows: xxorax/node-shell-escape#9 Fixes #15
Windows doesn't like single quotes to be used as argument "wrappers", it will try to include them literally in the command-line argument.
Example:
write-file
When I call
node write-file 'hello.txt'
, it creates literally the file'hello.txt'
, with quotes.The text was updated successfully, but these errors were encountered: