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

Function ensureDirectoryExists

packages/utils/src/lib/file-system.ts:34–45  ·  view source on GitHub ↗
(baseDir: string)

Source from the content-addressed store, hash-verified

32}
33
34export async function ensureDirectoryExists(baseDir: string) {
35 try {
36 await mkdir(baseDir, { recursive: true });
37 return;
38 } catch (error) {
39 const fsError = error as NodeJS.ErrnoException;
40 logger.warn(fsError.message);
41 if (fsError.code !== 'EEXIST') {
42 throw error;
43 }
44 }
45}
46
47export async function removeDirectoryIfExists(dir: string) {
48 if (await directoryExists(dir)) {

Callers 10

mergeDiffsFunction · 0.90
compareReportFilesFunction · 0.90
runner.int.test.tsFile · 0.90
writeRunnerResultsFunction · 0.90
runLighthouseForUrlFunction · 0.90
createFunction · 0.90
createRunnerFilesFunction · 0.70
loadReportFunction · 0.50

Calls 2

mkdirFunction · 0.85
warnMethod · 0.80

Tested by

no test coverage detected