diff --git a/index.js b/index.js index 59ac9c1..e9c4eba 100644 --- a/index.js +++ b/index.js @@ -288,8 +288,11 @@ function runCmd_ (cmd, pkg, env, wd, opts, stage, unsafe, uid, gid, cb_) { sh = customShell } else if (isWindows) { sh = process.env.comspec || 'cmd' - shFlag = '/d /s /c' - conf.windowsVerbatimArguments = true + // '/d /s /c' is used only for cmd.exe. + if (/^(?:.*\\)?cmd(?:\.exe)?$/i.test(sh)) { + shFlag = '/d /s /c' + conf.windowsVerbatimArguments = true + } } opts.log.verbose('lifecycle', logid(pkg, stage), 'PATH:', env[PATH])