Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/document-child-process-env.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"effect": patch
---

Document that `CommandOptions.extendEnv` defaults to `false` and that providing `env` without enabling it replaces the inherited child environment.
9 changes: 8 additions & 1 deletion packages/effect/src/unstable/process/ChildProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,11 @@ export interface CommandOptions extends KillOptions {
* If `extendEnv` is set to `true`, the value of `env` will be merged with
* the value of `globalThis.process.env`, prioritizing the values in `env`
* when conflicts exist.
*
* **Gotchas**
*
* Without `extendEnv: true`, providing `env` replaces the inherited child
* environment. The child will not receive `PATH` unless `env` includes it.
*/
readonly env?: Record<string, string | undefined> | undefined
/**
Expand All @@ -392,7 +397,9 @@ export interface CommandOptions extends KillOptions {
*
* **Details**
*
* If set to `false`, only the value of `env` is used.
* If set to `false` and `env` is provided, only the value of `env` is used.
*
* @default false
*/
readonly extendEnv?: boolean | undefined
/**
Expand Down
Loading