Skip to content

Commit 32c0b11

Browse files
alan-agius4josephperrott
authored andcommitted
fix(ng-dev): use getBazelBin instead of yarn bazelisk (#2533)
`bazelisk` is not an NPM script in the package.json PR Close #2533
1 parent 33ed067 commit 32c0b11

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {ReleaseInfoJsonStdout} from '../info/cli.js';
1919
import {ReleasePrecheckJsonStdin} from '../precheck/cli.js';
2020
import {BuiltPackageWithInfo} from '../config/index.js';
2121
import {green, Log} from '../../utils/logging.js';
22+
import {getBazelBin} from '../../utils/bazel-bin.js';
2223

2324
/*
2425
* ###############################################################
@@ -262,19 +263,10 @@ export abstract class ExternalCommands {
262263
* to refresh Aspect lock files.
263264
*/
264265
static async invokeBazelUpdateAspectLockFiles(projectDir: string): Promise<void> {
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-
270266
try {
271267
// Note: No progress indicator needed as that is the responsibility of the command.
272268
// TODO: Consider using an Ora spinner instead to ensure minimal console output.
273-
await ChildProcess.spawn(
274-
yarnCommand.binary,
275-
[...yarnCommand.args, 'bazelisk', 'run', '@npm2//:sync'],
276-
{cwd: projectDir},
277-
);
269+
await ChildProcess.spawn(getBazelBin(), ['run', '@npm2//:sync'], {cwd: projectDir});
278270
} catch (e) {
279271
// Note: Gracefully handling these errors because `sync` command
280272
// alway exits with a non-zero exit code.

0 commit comments

Comments
 (0)