Skip to content
Myr

Fix `extendEnv: false` inheriting `process.env` when `env` is not set

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

authored by Sindre Sorhus · committed by Sindre Sorhus · parent 8017b27 · Browse files · 4 files+21 added−5 removed
This commit

State

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

Diff stats

4 files+21 added−5 removed

  • tests:+17 added−2 removed
  • other:+4 added−3 removed

4 files+21 added−5 removed

modified:docs/api.md+1 added-1 removed
876 unmodified lines
877878### options.env879880_Type:_ `object`\881_Default:_ [`process.env`](https://nodejs.org/api/process.html#processenv)881_Default:_ `{}`882883[Environment variables](https://en.wikipedia.org/wiki/Environment_variable).884885Unless the [`extendEnv`](#optionsextendenv) option is `false`, the subprocess also uses the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).
476 unmodified lines
modified:lib/arguments/options.js+2 added-1 removed
modified:test/arguments/env.js+17 added-2 removed
modified:types/arguments/options.d.ts+1 added-1 removed
77 unmodified lines
78 [Environment variables](https://en.wikipedia.org/wiki/Environment_variable).7980 Unless the `extendEnv` option is `false`, the subprocess also uses the current process' environment variables ([`process.env`](https://nodejs.org/api/process.html#processenv)).8182 @default [process.env](https://nodejs.org/api/process.html#processenv)82 @default {}83 */84 readonly env?: Readonly<Partial<Record<string, string>>>;8586 /**
339 unmodified lines