MCPcopy Index your code
hub / github.com/MALSync/MALSync / checkIfFolderExists

Function checkIfFolderExists

test/headless/test.js:336–357  ·  view source on GitHub ↗
(block, name)

Source from the content-addressed store, hash-verified

334}
335
336function checkIfFolderExists(block, name) {
337 const root = path.join(__dirname, '../dist/headless/');
338
339 if (!fs.existsSync(root)) {
340 fs.mkdirSync(root);
341 }
342
343 const clearPath = path.join(root, 'clear');
344 if (!fs.existsSync(clearPath)) {
345 fs.mkdirSync(clearPath);
346 }
347
348 const folderPath = path.join(clearPath, block);
349 if (!fs.existsSync(folderPath)) {
350 fs.mkdirSync(folderPath);
351 }
352
353 const filePath = path.join(folderPath, name);
354 if (!fs.existsSync(filePath)) {
355 fs.mkdirSync(filePath);
356 }
357}
358
359async function singleCase(block, test, page, testPage, retry = 0) {
360 const saveCallback = await PreparePage(block, page, test.url, testPage);

Callers 1

PreparePageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected