Skip to content
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

Empty string argument should be quoted #14

Open
njam opened this issue Jul 6, 2018 · 1 comment
Open

Empty string argument should be quoted #14

njam opened this issue Jul 6, 2018 · 1 comment

Comments

@njam
Copy link

njam commented Jul 6, 2018

Currently an empty string argument becomes an empty string, and is thus ignored by the shell:

$ node -e "let esc = require('shell-escape'); console.log('|' + esc(['']) + '|')"
||

Instead an empty string should become as '' I think.

@njam njam changed the title Empty string argument should be quotes Empty string argument should be quoted Jul 6, 2018
@binki
Copy link

binki commented Jul 7, 2018

If I may suggest this, it is often better to try to use something like cross-spawn which accepts an array of arguments and knows how to target the current platform (see #9). You will have a more portable and safe program if you use that approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants