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

Function handler

ng-dev/release/info/cli.ts:47–64  ·  view source on GitHub ↗

Yargs command handler for printing release information.

(argv: Arguments<ReleaseInfoOptions>)

Source from the content-addressed store, hash-verified

45
46/** Yargs command handler for printing release information. */
47async function handler(argv: Arguments<ReleaseInfoOptions>) {
48 const config = await getConfig();
49 assertValidReleaseConfig(config);
50
51 // If JSON output is requested, print the information as JSON to stdout.
52 if (argv.json) {
53 process.stdout.write(JSON.stringify(<ReleaseInfoJsonStdout>config.release, null, 2));
54 return;
55 }
56
57 const git = await GitClient.get();
58 const nextBranchName = getNextBranchName(git.config.github);
59 const repo: ReleaseRepoWithApi = {api: git.github, ...git.remoteConfig, nextBranchName};
60 const releaseTrains = await ActiveReleaseTrains.fetch(repo);
61
62 // Print the active release trains.
63 await printActiveReleaseTrains(releaseTrains, config.release);
64}
65
66/** CLI command module for retrieving release information. */
67export const ReleaseInfoCommandModule: CommandModule<{}, ReleaseInfoOptions> = {

Callers

nothing calls this directly

Calls 8

getConfigFunction · 0.85
assertValidReleaseConfigFunction · 0.85
getNextBranchNameFunction · 0.85
printActiveReleaseTrainsFunction · 0.85
fetchMethod · 0.80
writeMethod · 0.45
stringifyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected