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

child_process.spawn double quotes problem in [args] parameters. #10461

Closed
Sergaros opened this issue Dec 26, 2016 · 1 comment
Closed

child_process.spawn double quotes problem in [args] parameters. #10461

Sergaros opened this issue Dec 26, 2016 · 1 comment
Labels
child_process Issues and PRs related to the child_process subsystem. question Issues that look for answers.

Comments

@Sergaros
Copy link

Sergaros commented Dec 26, 2016

  • v7.2.1:
  • 64-bit (Windows 10):
  • child_process:

And I have problem if I use double quotes in child_process.spawn [args] parameters.
Example:

let ps = spawn('ant.bat', ['-propertyfile ', prop1, '-propertyfile ', prop2, '-Dgit.branch='+branch, '-Dinstallfile.suffix="'+prop4+'"'];

As result I got an error in my code, because normalizeSpawnArguments() take all command string in double quotes too. So please try to handle this situation in normalizeSpawnArguments or describe this limitation in the docs.

@mscdex mscdex added child_process Issues and PRs related to the child_process subsystem. question Issues that look for answers. labels Dec 26, 2016
@joaocgreis
Copy link
Member

@Sergaros try to set the shell option:

let ps = spawn('ant.bat', ['-propertyfile ', prop1, '-propertyfile ', prop2, '-Dgit.branch='+branch, '-Dinstallfile.suffix="'+prop4+'"'], { shell:true });

Relevant docs: https://nodejs.org/dist/v7.2.1/docs/api/child_process.html#child_process_spawning_bat_and_cmd_files_on_windows

haifengkao added a commit to haifengkao/vscode-swift-development-environment that referenced this issue Sep 6, 2019
-XSwiftc will take double quote as the argument, but nodejs needs `shell: true` to support it (nodejs/node#10461)

close vknabel#55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
child_process Issues and PRs related to the child_process subsystem. question Issues that look for answers.
Projects
None yet
Development

No branches or pull requests

4 participants