( config: RunnerConfig, args: RunnerArgs, )
| 29 | }; |
| 30 | |
| 31 | export async function executeRunnerConfig( |
| 32 | config: RunnerConfig, |
| 33 | args: RunnerArgs, |
| 34 | ): Promise<unknown> { |
| 35 | const { outputFile, outputTransform } = config; |
| 36 | |
| 37 | await executeProcess({ |
| 38 | command: config.command, |
| 39 | args: config.args, |
| 40 | env: { ...process.env, ...runnerArgsToEnv(args) }, |
| 41 | }); |
| 42 | |
| 43 | // read process output from the file system and parse it |
| 44 | const outputs = await readJsonFile(outputFile); |
| 45 | // clean up plugin individual runner output directory |
| 46 | await removeDirectoryIfExists(path.dirname(outputFile)); |
| 47 | |
| 48 | // transform unknownAuditOutputs to auditOutputs |
| 49 | return outputTransform ? await outputTransform(outputs) : outputs; |
| 50 | } |
| 51 | |
| 52 | export async function executeRunnerFunction( |
| 53 | runner: RunnerFunction, |
no test coverage detected