Yargs command handler for staging a release.
(flags: Arguments<ReleasePublishOptions>)
| 35 | |
| 36 | /** Yargs command handler for staging a release. */ |
| 37 | async function handler(flags: Arguments<ReleasePublishOptions>) { |
| 38 | const git = await AuthenticatedGitClient.get(); |
| 39 | const config = await getConfig(); |
| 40 | assertValidReleaseConfig(config); |
| 41 | assertValidGithubConfig(config); |
| 42 | |
| 43 | const task = new ReleaseTool(git, config.release, config.github, git.baseDir, flags); |
| 44 | const result = await task.run(); |
| 45 | |
| 46 | switch (result) { |
| 47 | case CompletionState.FATAL_ERROR: |
| 48 | Log.error(`Release action has been aborted due to fatal errors. See above.`); |
| 49 | process.exitCode = 2; |
| 50 | break; |
| 51 | case CompletionState.MANUALLY_ABORTED: |
| 52 | Log.info(yellow(`Release action has been manually aborted.`)); |
| 53 | process.exitCode = 1; |
| 54 | break; |
| 55 | case CompletionState.SUCCESS: |
| 56 | Log.info(green(`Release action has completed successfully.`)); |
| 57 | break; |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | /** CLI command module for publishing a release. */ |
| 62 | export const ReleasePublishCommandModule: CommandModule<{}, ReleasePublishOptions> = { |
nothing calls this directly
no test coverage detected