Skip to content
Myr

Add localDir option to specify location of locally installed binaries (#73)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Austin Burdine · committed by Sindre Sorhus · parent e370117 · Browse files · 2 files+9 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+9 added−1 removed

  • other:+9 added−1 removed

2 files+9 added−1 removed

modified:index.js+2 added-1 removed
35 unmodified lines
36 opts = Object.assign({37 maxBuffer: TEN_MEGABYTES,38 stripEof: true,39 preferLocal: true,40 localDir: parsed.options.cwd || process.cwd(),41 encoding: 'utf8',42 reject: true,43 cleanup: true44 }, parsed.options);4546 opts.stdio = stdio(opts);4748 if (opts.preferLocal) {48 opts.env = npmRunPath.env(opts);49 opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));50 }5152 return {53 cmd: parsed.command,
256 unmodified lines
modified:readme.md+7 added
174 unmodified lines
175176Prefer locally installed binaries when looking for a binary to execute.<br>177If you `$ npm install foo`, you can then `execa('foo')`.178179#### localDir180181Type: `string`<br>182Default: `process.cwd()`183184Preferred path to find locally installed binaries in (use with `preferLocal`).185186#### input187188Type: `string` `Buffer` `stream.Readable`189
90 unmodified lines