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

Method runCommand

src/cli/command-runner.ts:16–33  ·  view source on GitHub ↗

* run command using one of the handler, "json"/"report"/"render". once done, exit the process.

()

Source from the content-addressed store, hash-verified

14 * run command using one of the handler, "json"/"report"/"render". once done, exit the process.
15 */
16 async runCommand() {
17 try {
18 await this.runMigrateIfNeeded();
19 if (this.flags.json) {
20 return await this.runJsonHandler();
21 }
22 if (this.shouldRunRender()) {
23 return await this.runRenderHandler();
24 }
25 if (this.command.report) {
26 return await this.runReportHandler();
27 }
28 } catch (err) {
29 return handleErrorAndExit(err, this.command.name, this.command.internal);
30 }
31
32 throw new Error(`command "${this.command.name}" doesn't implement "render" nor "report" methods`);
33 }
34
35 /**
36 * when both "render" and "report" were implemented, check whether it's a terminal.

Callers 1

execActionFunction · 0.95

Calls 6

runMigrateIfNeededMethod · 0.95
runJsonHandlerMethod · 0.95
shouldRunRenderMethod · 0.95
runRenderHandlerMethod · 0.95
runReportHandlerMethod · 0.95
handleErrorAndExitFunction · 0.85

Tested by

no test coverage detected