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

Callers

nothing calls this directly

Calls 2

isUsingPnpmMethod · 0.80

Tested by

no test coverage detected