MCPcopy Create free account
hub / github.com/code-pushup/cli / createRunnerFiles

Function createRunnerFiles

packages/utils/src/lib/create-runner-files.ts:13–29  ·  view source on GitHub ↗
(
  pluginSlug: string,
  configJSON: string,
)

Source from the content-addressed store, hash-verified

11 * @param configJSON - config of the plugin runner as JSON.
12 */
13export async function createRunnerFiles(
14 pluginSlug: string,
15 configJSON: string,
16): Promise<RunnerFilesPaths> {
17 const uniqueId = getUniqueProcessThreadId();
18 const runnerWorkDir = path.join(pluginWorkDir(pluginSlug), uniqueId);
19 const runnerConfigPath = path.join(runnerWorkDir, 'plugin-config.json');
20 const runnerOutputPath = path.join(runnerWorkDir, 'runner-output.json');
21
22 await ensureDirectoryExists(path.dirname(runnerOutputPath));
23 await writeFile(runnerConfigPath, configJSON);
24
25 return {
26 runnerConfigPath,
27 runnerOutputPath,
28 };
29}

Callers

nothing calls this directly

Calls 4

getUniqueProcessThreadIdFunction · 0.85
pluginWorkDirFunction · 0.85
writeFileFunction · 0.85
ensureDirectoryExistsFunction · 0.70

Tested by

no test coverage detected