summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/child_process.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/child_process.js b/lib/child_process.js
index a2a576e946..77f02a0ed2 100644
--- a/lib/child_process.js
+++ b/lib/child_process.js
@@ -440,9 +440,11 @@ function normalizeSpawnArguments(file, args, options) {
const command = [file].concat(args).join(' ');
if (process.platform === 'win32') {
- file = typeof options.shell === 'string' ? options.shell :
- process.env.comspec || 'cmd.exe';
- args = ['/d', '/s', '/c', '"' + command + '"'];
+ if (typeof options.shell === 'string')
+ file = options.shell;
+ else
+ file = process.env.comspec || 'cmd.exe';
+ args = ['/d', '/s', '/c', `"${command}"`];
options.windowsVerbatimArguments = true;
} else {
if (typeof options.shell === 'string')