MCPcopy
hub / github.com/teambit/bit / runReportHandler

Method runReportHandler

src/cli/command-runner.ts:66–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64 }
65
66 private async runReportHandler() {
67 if (!this.command.report) throw new Error('runReportHandler expects command.report to be implemented');
68 const result = await this.command.report(this.args, this.flags);
69 loader.off();
70 const data = typeof result === 'string' ? result : result.data;
71 const exitCode = typeof result === 'string' ? 0 : result.code;
72 return this.writeAndExit(`${data}\n`, exitCode);
73 }
74
75 private writeAndExit(data: string, exitCode: number) {
76 return process.stdout.write(data, () => logger.exitAfterFlush(exitCode, this.command.name));

Callers 1

runCommandMethod · 0.95

Calls 2

writeAndExitMethod · 0.95
reportMethod · 0.65

Tested by

no test coverage detected