UNPKG

molstar

Version:

A comprehensive macromolecular library.

24 lines 754 B
"use strict"; /** * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal <david.sehnal@gmail.com> */ Object.defineProperty(exports, "__esModule", { value: true }); exports.makeDir = void 0; var tslib_1 = require("tslib"); var fs = (0, tslib_1.__importStar)(require("fs")); function makeDir(path, root) { var dirs = path.split(/\/|\\/g), dir = dirs.shift(); root = (root || '') + dir + '/'; try { fs.mkdirSync(root); } catch (e) { if (!fs.statSync(root).isDirectory()) throw new Error(e); } return !dirs.length || makeDir(dirs.join('/'), root); } exports.makeDir = makeDir; //# sourceMappingURL=make-dir.js.map