From 2b5c9393f9d064654c0ee61242808b546c1530df Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Wed, 8 Jan 2025 19:04:50 +0000 Subject: [PATCH] fix(ng-dev): use `getBazelBin` instead of `yarn bazelisk` `bazelisk` is not an NPM script in the package.json --- ng-dev/release/publish/external-commands.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/ng-dev/release/publish/external-commands.ts b/ng-dev/release/publish/external-commands.ts index 7a6c764ac..b977867b4 100644 --- a/ng-dev/release/publish/external-commands.ts +++ b/ng-dev/release/publish/external-commands.ts @@ -19,6 +19,7 @@ import {ReleaseInfoJsonStdout} from '../info/cli.js'; import {ReleasePrecheckJsonStdin} from '../precheck/cli.js'; import {BuiltPackageWithInfo} from '../config/index.js'; import {green, Log} from '../../utils/logging.js'; +import {getBazelBin} from '../../utils/bazel-bin.js'; /* * ############################################################### @@ -262,19 +263,10 @@ export abstract class ExternalCommands { * to refresh Aspect lock files. */ static async invokeBazelUpdateAspectLockFiles(projectDir: string): Promise { - // 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); - try { // Note: No progress indicator needed as that is the responsibility of the command. // TODO: Consider using an Ora spinner instead to ensure minimal console output. - await ChildProcess.spawn( - yarnCommand.binary, - [...yarnCommand.args, 'bazelisk', 'run', '@npm2//:sync'], - {cwd: projectDir}, - ); + await ChildProcess.spawn(getBazelBin(), ['run', '@npm2//:sync'], {cwd: projectDir}); } catch (e) { // Note: Gracefully handling these errors because `sync` command // alway exits with a non-zero exit code.