Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions ng-dev/release/publish/external-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/*
* ###############################################################
Expand Down Expand Up @@ -262,19 +263,10 @@ export abstract class ExternalCommands {
* to refresh Aspect lock files.
*/
static async invokeBazelUpdateAspectLockFiles(projectDir: string): Promise<void> {
// 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.
Expand Down
Loading