MCPcopy Create free account
hub / github.com/angular/dev-infra / spawnInteractive

Function spawnInteractive

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

* Spawns a given command with the specified arguments inside an interactive shell. All process * stdin, stdout and stderr output is printed to the current console. * * @returns a Promise resolving on success, and rejecting on command failure with the status code.

(
    command: string,
    args: string[],
    options: SpawnInteractiveCommandOptions = {},
  )

Source from the content-addressed store, hash-verified

64 * Spawns a given command with the specified arguments inside an interactive shell. All process
65 * stdin, stdout and stderr output is printed to the current console.
66 *
67 * @returns a Promise resolving on success, and rejecting on command failure with the status code.
68 */
69 static spawnInteractive(
70 command: string,
71 args: string[],
72 options: SpawnInteractiveCommandOptions = {},
73 ) {
74 return new Promise<void>((resolve, reject) => {
75 const commandText = `${command} ${args.join(' ')}`;
76 const env = sanitizeEnvironmentPath(
77 options.env ?? process.env,
78 getExcludedDirsForCwd(options.cwd),
79 );
80 Log.debug(`Executing command: ${sanitize(commandText)}`);
81 const childProcess = _spawn(command, args, {...options, env, stdio: 'inherit'});
82 childProcess.on('error', (err) => {
83 const sanitizedErr = sanitizeError(err);

Callers

nothing calls this directly

Calls 3

sanitizeFunction · 0.85
resolveFunction · 0.85
onMethod · 0.45

Tested by

no test coverage detected