Skip to content

Commit

Permalink
fix: npm explore spawn shell correctly
Browse files Browse the repository at this point in the history
PR-URL: #784
Credit: @jasisk
Close: #784
Reviewed-by: @isaacs
  • Loading branch information
jasisk authored and isaacs committed Jul 20, 2020
1 parent 0350ae5 commit e19d1a7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/explore.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ function explore (args, cb) {
var opts = {cwd: cwd, stdio: 'inherit'}

var shellArgs = []
if (args) {
if (args.length) {
if (isWindows) {
var execCmd = escapeExecPath(args.shift())
var execArgs = [execCmd].concat(args.map(escapeArg))
opts.windowsVerbatimArguments = true
shellArgs = ['/d', '/s', '/c'].concat(execArgs)
} else {
shellArgs.unshift('-c')
shellArgs = ['-c', args.map(escapeArg).join(' ').trim()]
}
}
Expand Down

0 comments on commit e19d1a7

Please sign in to comment.