mirror of https://github.com/nodejs/node.git
child_process: use full path for cmd.exe on Win32
Currently child_process.exec() assumes that cmd.exe is on the PATH, and fails with a spawn ENOENT error if it is not. The Windows 'comspec' environment variable contains the full filepath to the default command interpreter, eg "C:\Windows\System32\cmd.exe". Should it not be set, we fall-back to using 'cmd.exe' from PATH, as before. Signed-off-by: Fedor Indutny <fedor@indutny.com>archived-io.js-v0.10
parent
4f1782ef75
commit
c08da463ad
|
@ -608,7 +608,7 @@ function normalizeExecArgs(command /*, options, callback */) {
|
|||
}
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
file = 'cmd.exe';
|
||||
file = process.env.comspec || 'cmd.exe';
|
||||
args = ['/s', '/c', '"' + command + '"'];
|
||||
// Make a shallow copy before patching so we don't clobber the user's
|
||||
// options object.
|
||||
|
|
Loading…
Reference in New Issue