MCPcopy Create free account
hub / github.com/garris/BackstopJS / ensureDirectoryPath

Function ensureDirectoryPath

core/util/ensureDirectoryPath.js:4–11  ·  view source on GitHub ↗
(filePath)

Source from the content-addressed store, hash-verified

2const fs = require('fs');
3
4function ensureDirectoryPath (filePath) {
5 const dirname = path.dirname(filePath);
6 if (fs.existsSync(dirname)) {
7 return true;
8 }
9 ensureDirectoryPath(dirname);
10 fs.mkdirSync(dirname);
11}
12
13module.exports = function (path) {
14 return ensureDirectoryPath(path);

Callers 6

captureScreenshotFunction · 0.85
selectorsShotFunction · 0.85
captureScreenshotFunction · 0.85
selectorsShotFunction · 0.85
writeCompareConfigFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected