Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

Commit

Permalink
fix(child): exec does not have the information needed to correctly es…
Browse files Browse the repository at this point in the history
…cape its args
  • Loading branch information
zkat committed Jun 20, 2017
1 parent bd4e538 commit 6714992
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions child.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ function exec (cmd, args, opts) {
opts = opts || {}
return BB.fromNode(cb => {
cp.exec(`${escapeArg(cmd, true)} ${
args.map(arg => escapeArg(arg)).join(' ')
args.join(' ')
}`, opts, cb)
})
}

module.exports._escapeArg = escapeArg
module.exports.escapeArg = escapeArg
function escapeArg (str, asPath) {
return process.platform === 'win32' && asPath
? path.normalize(str)
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function getNpmCache (opts) {
return which(opts.npm).then(npmPath => {
const args = ['config', 'get', 'cache']
if (opts.userconfig) {
args.push('--userconfig', opts.userconfig)
args.push('--userconfig', child.escapeArg(opts.userconfig, true))
}
return child.exec(npmPath, args)
}).then(cache => cache.trim())
Expand Down

0 comments on commit 6714992

Please sign in to comment.