doxygen
Version:
node module for doxygen documentation
26 lines (23 loc) • 656 B
JavaScript
/**
* @file helpers.js
* Helpers in the doxygen module
*/
;
var fs = require("fs");
var path = require("path");
module.exports.ensureDirectoryExistence = ensureDirectoryExistence;
/**
* Makes sure that a folder route exists, creating
* the folders if necesary
* @param {String} filePath - The path.
* @param {Boolean} notDir - True if the path does not reference a directory
*/
function ensureDirectoryExistence(filePath, notDir) {
if (!fs.existsSync(filePath)) {
var dirname = path.dirname(filePath);
ensureDirectoryExistence(dirname);
if (!notDir) {
fs.mkdirSync(filePath);
}
}
}