MCPcopy Index your code
hub / github.com/angular/dev-infra / getEnvironmentForNonInteractiveCommand

Function getEnvironmentForNonInteractiveCommand

ng-dev/utils/child-process.ts:170–178  ·  view source on GitHub ↗

* Gets a process environment object with defaults that can be used for * spawning non-interactive child processes. * * Currently we enable `FORCE_COLOR` since non-interactive spawn's with * non-inherited `stdio` will not have colors enabled due to a missing TTY.

(
  userProvidedEnv?: NodeJS.ProcessEnv,
)

Source from the content-addressed store, hash-verified

168 * non-inherited `stdio` will not have colors enabled due to a missing TTY.
169 */
170function getEnvironmentForNonInteractiveCommand(
171 userProvidedEnv?: NodeJS.ProcessEnv,
172): NodeJS.ProcessEnv {
173 // Pass through the color level from the TTY/process performing the `spawn` call.
174 const forceColorValue =
175 supportsColor.stdout !== false ? supportsColor.stdout.level.toString() : undefined;
176
177 return {FORCE_COLOR: forceColorValue, ...(userProvidedEnv ?? process.env)};
178}
179
180/**
181 * Process the ChildProcess object created by an async command.

Callers 3

spawnSyncFunction · 0.85
spawnFunction · 0.85
execFunction · 0.85

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected