UNPKG

nucleus-ui-builder

Version:
33 lines (32 loc) 925 B
function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } import * as fs from "fs"; import * as path from "path"; class WriteFileCommand { execute() { const directory = path.dirname(this.filePath); if (!fs.existsSync(directory)) fs.mkdirSync(directory, { recursive: true }); fs.writeFileSync(this.filePath, this.content, `utf8`); } constructor(filePath, content){ _define_property(this, "filePath", void 0); _define_property(this, "content", void 0); this.filePath = filePath; this.content = content; } } export { WriteFileCommand as default }; //# sourceMappingURL=write.file.command.js.map