(
args: string[],
projectDir: string,
spawnOptions: SpawnOptions = {},
)
| 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 | /** |
nothing calls this directly
no test coverage detected