MCPcopy Index your code
hub / github.com/api3dao/airnode / runCommand

Function runCommand

docker/scripts/utils.ts:22–40  ·  view source on GitHub ↗
(command: string, options?: ExecSyncOptions)

Source from the content-addressed store, hash-verified

20};
21
22export const runCommand = (command: string, options?: ExecSyncOptions) => {
23 const { hiddenCommand, hiddenOptions } = hideSecrets(command, options);
24
25 logger.log(`Running command: '${hiddenCommand}' with options ${JSON.stringify(hiddenOptions)}`);
26 try {
27 return execSync(command, options)?.toString().trim();
28 } catch (e) {
29 // Thrown Error object contains the entire result from child_process.spawnSync()
30 const err = e as any;
31 throw new Error(
32 [
33 ``,
34 `Command failed with non-zero status code: ${err.status}`,
35 `Stderr: ${err.stderr?.toString().trim()}.`,
36 `Stdout: ${err.stdout?.toString().trim()}.`,
37 ].join('\n')
38 );
39 }
40};
41
42export const unifyUrlFormat = (url: string) => (url.endsWith('/') ? url.slice(0, -1) : url);
43

Callers 15

configFunction · 0.90
cloneFunction · 0.90
checkoutFunction · 0.90
listFilesFunction · 0.90
addFunction · 0.90
commitFunction · 0.90
pushFunction · 0.90
branchExistsFunction · 0.90
createBranchFunction · 0.90
tagFunction · 0.90
authenticateFunction · 0.90
getNpmRegistryContainerFunction · 0.90

Calls 1

hideSecretsFunction · 0.85

Tested by

no test coverage detected