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

Commit

Permalink
fix(windows): Allow spaces in the node path when using --node-arg (#173)
Browse files Browse the repository at this point in the history
Fixes: #170
  • Loading branch information
Noah Leigh authored and zkat committed Apr 12, 2018
1 parent 13fea31 commit fe0d48a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -283,7 +283,7 @@ function execCommand (_existing, argv) {
nargs = nargs.reduce((acc, arg) => {
return acc.concat(arg.split(/\s+/))
}, [])
cmd = process.argv[0]
cmd = child.escapeArg(process.argv[0], true)
opts = Object.assign({}, argv, {
cmdOpts: nargs.concat([existing], argv.cmdOpts || [])
})
Expand Down
13 changes: 13 additions & 0 deletions test/index.js
Expand Up @@ -294,3 +294,16 @@ test('nice error message when no binaries on windows', {
t.end()
})
})

test('--node-arg works on Windows', {
skip: !isWindows && 'Only on Windows does --node-arg have issues'
}, t => {
return child.spawn('node', [
NPX_ESC, '--quiet',
'--node-arg', '--no-deprecation',
'echo-cli', 'hewwo'
], {stdio: 'pipe'}).then(res => {
t.equal(res.stdout.trim(), 'hewwo')
t.end()
})
})

0 comments on commit fe0d48a

Please sign in to comment.