Currently the active release trains are printed when a developer runs `ng-dev publish release`. This is not ideal because it requires the developer to provide an OAuth token, to be on the next branch, and to have no uncommitted changes, while the actual release train information is not dependent on these checks. This commit introduces a new command called `ng-dev release info` that can be used to retrieve relase information without the aforementioned requirements. Note that this command provides more detailed information about release branches than the `ng-dev caretaker check` command (which also requires on authentication as a side note). The `release info` command also prints active LTS branches for example. PR Close #42644
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
|
|
import {CommandModule} from 'yargs';
|
|
|
|
import {info} from '../../utils/console';
|
|
import {GitClient} from '../../utils/git/git-client';
|
|
import {getReleaseConfig} from '../config/index';
|
|
import {fetchActiveReleaseTrains} from '../versioning/active-release-trains';
|
|
import {printActiveReleaseTrains} from '../versioning/print-active-trains';
|
|
|
|
/** Yargs command handler for printing release information. */
|
|
async function handler() {
|
|
const git = GitClient.get();
|
|
const gitRepoWithApi = {api: git.github, ...git.remoteConfig};
|
|
const releaseTrains = await fetchActiveReleaseTrains(gitRepoWithApi);
|
|
|
|
// Print the active release trains.
|
|
await printActiveReleaseTrains(releaseTrains, getReleaseConfig());
|
|
}
|
|
|
|
/** CLI command module for retrieving release information. */
|
|
export const ReleaseInfoCommandModule: CommandModule = {
|
|
handler,
|
|
command: 'info',
|
|
describe: 'Prints active release trains to the console.',
|
|
};
|