diff --git a/ng-dev/cli.ts b/ng-dev/cli.ts index 66a68e20e..83fa293e4 100644 --- a/ng-dev/cli.ts +++ b/ng-dev/cli.ts @@ -19,7 +19,7 @@ import {buildPullapproveParser} from './pullapprove/cli.js'; import {buildReleaseParser} from './release/cli.js'; import {tsCircularDependenciesBuilder} from './ts-circular-dependencies/index.js'; import {captureLogOutputForCommand} from './utils/logging.js'; -import {ngDevVersionMiddleware} from './utils/version-check.js'; +import {localVersion, ngDevVersionMiddleware} from './utils/version-check.js'; import {buildAuthParser} from './auth/cli.js'; import {buildPerfParser} from './perf/cli.js'; import {buildConfigParser} from './config/cli.js'; @@ -46,6 +46,7 @@ runParserWithCompletedFunctions((yargs: Argv) => { .command('perf ', '', buildPerfParser) .command('ai ', '', buildAiParser) .command('config ', false, buildConfigParser) + .version(localVersion) .wrap(120) .strict(); }); diff --git a/ng-dev/release/publish/external-commands.ts b/ng-dev/release/publish/external-commands.ts index 580093a14..8bfe2ae4b 100644 --- a/ng-dev/release/publish/external-commands.ts +++ b/ng-dev/release/publish/external-commands.ts @@ -256,20 +256,20 @@ export abstract class ExternalCommands { spawnOptions: SpawnOptions = {}, ): Promise { if (PnpmVersioning.isUsingPnpm(projectDir)) { - return ChildProcess.spawn('npx', ['--yes', 'pnpm', '-s', 'run', ...args], { - ...spawnOptions, - cwd: projectDir, - }); - } else { - // Note: We cannot use `yarn` directly as command because we might operate in - // a different publish branch and the current `PATH` will point to the Yarn version - // that invoked the release tool. More details in the function description. - const yarnCommand = await resolveYarnScriptForProject(projectDir); - return ChildProcess.spawn(yarnCommand.binary, [...yarnCommand.args, ...args], { + return ChildProcess.spawn('npx', ['--yes', 'pnpm', '-s', ...args], { ...spawnOptions, cwd: projectDir, }); } + + // Note: We cannot use `yarn` directly as command because we might operate in + // a different publish branch and the current `PATH` will point to the Yarn version + // that invoked the release tool. More details in the function description. + const yarnCommand = await resolveYarnScriptForProject(projectDir); + return ChildProcess.spawn(yarnCommand.binary, [...yarnCommand.args, ...args], { + ...spawnOptions, + cwd: projectDir, + }); } /** diff --git a/ng-dev/utils/version-check.ts b/ng-dev/utils/version-check.ts index 17b048ad9..664fd7f4a 100644 --- a/ng-dev/utils/version-check.ts +++ b/ng-dev/utils/version-check.ts @@ -19,7 +19,7 @@ import {GitClient} from './git/git-client.js'; * The currently executing version of ng-dev * Note: The placeholder will be replaced by the `pkg_npm` substitutions. */ -const localVersion = `0.0.0-{SCM_HEAD_SHA}`; +export const localVersion = `0.0.0-{SCM_HEAD_SHA}`; /** Whether ngDevVersionMiddleware verification has already occured. */ let verified = false;