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

Function persistResult

packages/core/src/lib/implementation/persist.ts:66–78  ·  view source on GitHub ↗
(reportPath: string, content: string)

Source from the content-addressed store, hash-verified

64}
65
66function persistResult(reportPath: string, content: string): Promise<FileSize> {
67 return (
68 writeFile(reportPath, content)
69 // return reportPath instead of void
70 .then(() => stat(reportPath))
71 .then((stats): FileSize => ({ file: reportPath, size: stats.size }))
72 .catch((error: unknown) => {
73 throw new Error(
74 `Failed to save report in ${ansis.bold(reportPath)} - ${stringifyError(error)}`,
75 );
76 })
77 );
78}
79
80export function logPersistedReport(reportFiles: FileSize[]) {
81 logger.info(`Persisted report to file system:`);

Callers 1

persistReportFunction · 0.85

Calls 2

stringifyErrorFunction · 0.90
writeFileFunction · 0.85

Tested by

no test coverage detected