MCPcopy Create free account
hub / github.com/api3dao/airnode / runCommand

Function runCommand

packages/airnode-deployer/src/cli/index.ts:30–46  ·  view source on GitHub ↗
(command: () => Promise<any>)

Source from the content-addressed store, hash-verified

28}
29
30async function runCommand(command: () => Promise<any>) {
31 const goCommand = await go(command);
32 if (!goCommand.success) {
33 logger.consoleLog('\n\n\nError details:');
34
35 // Logging an error here likely results in excessive logging since the errors are usually logged at the place where they
36 // happen. However if we do not log the error here we risk having unhandled silent errors. The risk is not worth it.
37 if (goCommand.error instanceof MultiMessageError) {
38 goCommand.error.messages.forEach((m) => logger.fail(m));
39 } else {
40 logger.fail(goCommand.error.message);
41 }
42
43 // eslint-disable-next-line functional/immutable-data
44 process.exitCode = 1;
45 }
46}
47
48const cliExamples = [
49 'deploy -c config/config.json -s config/secrets.env -r config/receipt.json -l config/logs/',

Callers 1

index.tsFile · 0.70

Calls 1

failMethod · 0.80

Tested by

no test coverage detected