UNPKG

@foal/cli

Version:

CLI tool for FoalTS

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