Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

fix switches for alternative shells on Windows #26

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions index.js
Expand Up @@ -282,8 +282,11 @@ function runCmd_ (cmd, pkg, env, wd, opts, stage, unsafe, uid, gid, cb_) {
sh = customShell
} else if (process.platform === 'win32') {
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])
Expand Down