MCPcopy Create free account
hub / github.com/angular/dev-infra / invokeYarnInstall

Function invokeYarnInstall

ng-dev/release/publish/external-commands.ts:297–324  ·  view source on GitHub ↗

* Invokes the `yarn install` command in order to install dependencies for * the configured project with the currently checked out revision.

(projectDir: string)

Source from the content-addressed store, hash-verified

295 * the configured project with the currently checked out revision.
296 */
297 static async invokeYarnInstall(projectDir: string): Promise<void> {
298 // Note: We cannot use `yarn` directly as command because we might operate in
299 // a different publish branch and the current `PATH` will point to the Yarn version
300 // that invoked the release tool. More details in the function description.
301 const yarnCommand = await resolveYarnScriptForProject(projectDir);
302
303 try {
304 // Note: No progress indicator needed as that is the responsibility of the command.
305 // TODO: Consider using an Ora spinner instead to ensure minimal console output.
306 await ChildProcess.spawn(
307 yarnCommand.binary,
308 [
309 ...yarnCommand.args,
310 'install',
311 ...(yarnCommand.legacy ? ['--frozen-lockfile', '--non-interactive'] : ['--immutable']),
312 ],
313 {
314 cwd: projectDir,
315 mode: 'on-error',
316 },
317 );
318 Log.info(green(' ✓ Installed project dependencies.'));
319 } catch (e) {
320 Log.error(e);
321 Log.error(' ✘ An error occurred while installing dependencies.');
322 throw new FatalReleaseActionError();
323 }
324 }
325
326 /**
327 * Invokes the `pnpm install` command in order to install dependencies for

Callers

nothing calls this directly

Calls 2

errorMethod · 0.45

Tested by

no test coverage detected