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

Function _spawnNpmScript

ng-dev/release/publish/external-commands.ts:355–375  ·  view source on GitHub ↗
(
    args: string[],
    projectDir: string,
    spawnOptions: SpawnOptions = {},
  )

Source from the content-addressed store, hash-verified

353 }
354 }
355
356 private static async _spawnNpmScript(
357 args: string[],
358 projectDir: string,
359 spawnOptions: SpawnOptions = {},
360 ): Promise<SpawnResult> {
361 if (PnpmVersioning.isUsingPnpm(projectDir)) {
362 return ChildProcess.spawn('pnpm', ['--silent', ...args], {
363 ...spawnOptions,
364 cwd: projectDir,
365 });
366 }
367
368 // Note: We cannot use `yarn` directly as command because we might operate in
369 // a different publish branch and the current `PATH` will point to the Yarn version
370 // that invoked the release tool. More details in the function description.
371 const yarnCommand = await resolveYarnScriptForProject(projectDir);
372 return ChildProcess.spawn(yarnCommand.binary, [...yarnCommand.args, ...args], {
373 ...spawnOptions,
374 cwd: projectDir,
375 });
376 }
377
378 /**

Callers

nothing calls this directly

Calls 2

isUsingPnpmMethod · 0.80

Tested by

no test coverage detected