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

Commit

Permalink
fix(exec): use command lookup joined with current PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed May 31, 2017
1 parent a99d8cd commit d9175e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ function getCmdPath (command, spec, npmOpts) {
).then(cache => {
const prefix = path.join(cache, '_npx')
return installPackage(spec, prefix, npmOpts).then(() => {
return path.join(prefix, 'bin', command)
process.env.PATH = `${
path.join(prefix, 'bin')
}${PATH_SEP}${process.env.PATH}`
return which(command)
})
})
}
Expand Down

0 comments on commit d9175e8

Please sign in to comment.