Skip to content
Permalink
Browse files
Add localDir option to specify location of locally installed binaries (
  • Loading branch information
acburdine authored and sindresorhus committed Jun 9, 2017
1 parent e370117 commit 0f8f7a3da212aa8f8c00697e95fe77bcbcf6ca18
Showing 2 changed files with 9 additions and 1 deletion.
@@ -37,6 +37,7 @@ function handleArgs(cmd, args, opts) {
maxBuffer: TEN_MEGABYTES,
stripEof: true,
preferLocal: true,
localDir: parsed.options.cwd || process.cwd(),
encoding: 'utf8',
reject: true,
cleanup: true
@@ -45,7 +46,7 @@ function handleArgs(cmd, args, opts) {
opts.stdio = stdio(opts);

if (opts.preferLocal) {
opts.env = npmRunPath.env(opts);
opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
}

return {
@@ -176,6 +176,13 @@ Default: `true`
Prefer locally installed binaries when looking for a binary to execute.<br>
If you `$ npm install foo`, you can then `execa('foo')`.

#### localDir

Type: `string`<br>
Default: `process.cwd()`

Preferred path to find locally installed binaries in (use with `preferLocal`).

#### input

Type: `string` `Buffer` `stream.Readable`

0 comments on commit 0f8f7a3

Please sign in to comment.