sx-cli-tool
Version:
Laravel va Vue frameworklaridagi monolith arxitektura loyihalarni boshqarish uchun mo'ljallangan CLI tool
16 lines (15 loc) • 631 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ensureDirectoryExists = ensureDirectoryExists;
const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
// Function to ensure the directory exists, and if not, create it
function ensureDirectoryExists(filePath) {
const dir = path_1.default.dirname(filePath);
if (!fs_1.default.existsSync(dir)) {
fs_1.default.mkdirSync(dir, { recursive: true });
}
}