Skip to content

Commit 419c3aa

Browse files
committed
fix(ng-dev): remove redundant run from pnpm commands
Simplifies commands by using `pnpm` directly. Unlike `pnpm run`, the shorthand can execute both scripts and binaries not explicitly listed in `package.json`
1 parent 396dbb1 commit 419c3aa

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

ng-dev/release/publish/external-commands.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -256,20 +256,20 @@ export abstract class ExternalCommands {
256256
spawnOptions: SpawnOptions = {},
257257
): Promise<SpawnResult> {
258258
if (PnpmVersioning.isUsingPnpm(projectDir)) {
259-
return ChildProcess.spawn('npx', ['--yes', 'pnpm', '-s', 'run', ...args], {
260-
...spawnOptions,
261-
cwd: projectDir,
262-
});
263-
} else {
264-
// Note: We cannot use `yarn` directly as command because we might operate in
265-
// a different publish branch and the current `PATH` will point to the Yarn version
266-
// that invoked the release tool. More details in the function description.
267-
const yarnCommand = await resolveYarnScriptForProject(projectDir);
268-
return ChildProcess.spawn(yarnCommand.binary, [...yarnCommand.args, ...args], {
259+
return ChildProcess.spawn('npx', ['--yes', 'pnpm', '-s', ...args], {
269260
...spawnOptions,
270261
cwd: projectDir,
271262
});
272263
}
264+
265+
// Note: We cannot use `yarn` directly as command because we might operate in
266+
// a different publish branch and the current `PATH` will point to the Yarn version
267+
// that invoked the release tool. More details in the function description.
268+
const yarnCommand = await resolveYarnScriptForProject(projectDir);
269+
return ChildProcess.spawn(yarnCommand.binary, [...yarnCommand.args, ...args], {
270+
...spawnOptions,
271+
cwd: projectDir,
272+
});
273273
}
274274

275275
/**

0 commit comments

Comments
 (0)