UNPKG

foalts2-cli

Version:

CLI tool for FoalTS

17 lines (16 loc) 493 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.mkdirIfDoesNotExist = void 0; // std const fs_1 = require("fs"); function mkdirIfDoesNotExist(path) { const paths = path.split('/'); const paths2 = []; while (paths.length > 0) { paths2.push(paths.shift()); if (!fs_1.existsSync(paths2.join('/'))) { fs_1.mkdirSync(paths2.join('/')); } } } exports.mkdirIfDoesNotExist = mkdirIfDoesNotExist;