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

Function invokeReleaseInfo

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

* Invokes the `ng-dev release info` command in order to retrieve information * about the release for the currently checked-out branch. * * This is useful to e.g. determine whether a built package is currently * denoted as experimental or not.

(projectDir: string)

Source from the content-addressed store, hash-verified

138 * denoted as experimental or not.
139 */
140 static async invokeReleaseInfo(projectDir: string): Promise<ReleaseInfoJsonStdout> {
141 try {
142 const {stdout} = await this._spawnNpmScript(
143 ['ng-dev', 'release', 'info', '--json'],
144 projectDir,
145 {mode: 'silent'},
146 );
147
148 // The `ng-dev release info` command prints a JSON object to stdout.
149 return JSON.parse(stdout.trim()) as ReleaseInfoJsonStdout;
150 } catch (e) {
151 Log.error(e);
152 Log.error(
153 ` ✘ An error occurred while retrieving the release information for ` +
154 `the currently checked-out branch.`,
155 );
156 throw new FatalReleaseActionError();
157 }
158 }
159
160 /**
161 * Invokes the `ng-dev release precheck` command in order to validate the

Callers

nothing calls this directly

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected