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

Function runParserWithCompletedFunctions

ng-dev/utils/yargs.ts:18–34  ·  view source on GitHub ↗
(applyConfiguration: (argv: Argv) => Argv)

Source from the content-addressed store, hash-verified

16 * functions after the command completes.
17 */
18export async function runParserWithCompletedFunctions(applyConfiguration: (argv: Argv) => Argv) {
19 let err: Error | null = null;
20 try {
21 await applyConfiguration(yargs(process.argv.slice(2)))
22 .exitProcess(false)
23 .parse();
24 } catch (e) {
25 err = e as Error;
26 if ([undefined, 0].includes(process.exitCode as any)) {
27 process.exitCode = 1;
28 }
29 } finally {
30 for (const completedFunc of completedFunctions) {
31 await completedFunc(err);
32 }
33 }
34}

Callers 1

cli.tsFile · 0.85

Calls 1

sliceMethod · 0.45

Tested by

no test coverage detected