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

Function execAction

src/cli/command-registry.ts:47–64  ·  view source on GitHub ↗
(command: Command, concrete, args)

Source from the content-addressed store, hash-verified

45 * CLIExtension.run => commander.parse(params) => commander-pkg.parse => commander-pkg.parseArgs => execAction
46 */
47export async function execAction(command: Command, concrete, args): Promise<any> {
48 const flags = getOpts(concrete, command.options);
49 const relevantArgs = args.slice(0, args.length - 1);
50 Analytics.init(concrete.name(), flags, relevantArgs);
51 logger.info(`[*] started a new command: "${command.name}" with the following data:`, {
52 args: relevantArgs,
53 flags
54 });
55 if (command.loader && !flags.json) {
56 loader.on();
57 }
58 if (flags[TOKEN_FLAG_NAME]) {
59 globalFlags.token = flags[TOKEN_FLAG_NAME].toString();
60 }
61 logger.shouldWriteToConsole = !flags.json;
62 const commandRunner = new CommandRunner(command, relevantArgs, flags);
63 return commandRunner.runCommand();
64}
65
66/**
67 * register the action of each one of the commands.

Callers 1

registerActionFunction · 0.85

Calls 7

runCommandMethod · 0.95
getOptsFunction · 0.85
onMethod · 0.65
initMethod · 0.45
nameMethod · 0.45
infoMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected