UNPKG

angel-manager

Version:

<p align="center"> <img src="angel-manager.webp" alt="Angel Manager" width="300"> </p>

62 lines (61 loc) 2.83 kB
import { L as y, _ as w, a as x } from "./liquid.browser-ICKyr_MB.js"; import { b as q, f as B, g as L } from "./liquid.browser-ICKyr_MB.js"; import h from "path"; import v from "fs"; var F = ( /** @class */ /* @__PURE__ */ function() { function e() { } return e; }() ), P = new y(), S = function(e, n) { return w(void 0, void 0, void 0, function() { var o, f, i, r, t, c, a, s, u; return x(this, function(l) { switch (l.label) { case 0: o = h.join(n.__dirname, "src/scaffolding/architecture/".concat(e.templatePath, "/index.liquid")), f = v.readFileSync(o, "utf8"), i = "", e.file && e.file.name ? typeof e.file.name == "string" ? i = e.file.name : typeof e.file.name == "object" && (r = e.file.name.case, t = e.file.name.argName, c = e.file.name.plural, a = e.file.name.suffix, t in n.arguments[r] ? (i = c ? n.arguments.plural[r][t] : n.arguments[r][t], a && (i = i + a)) : (console.warn('Warning: The argument "'.concat(t, '" does not exist in the defined arguments.')), i = "undefined")) : i = "undefined", !((u = e.file) === null || u === void 0) && u.subDir && v.mkdirSync("".concat(n.__dirname, "/src/").concat(e.destinationPath, "/").concat(i), { recursive: !0 }), l.label = 1; case 1: return l.trys.push([1, 3, , 4]), [4, P.parseAndRender(f, n.arguments).then(function(g) { var d, p, _ = h.join(n.__dirname, "src/".concat(e.destinationPath, "/").concat(!((d = e.file) === null || d === void 0) && d.subDir ? i + "/" : "").concat(i, ".").concat((p = e.file) === null || p === void 0 ? void 0 : p.extension)); v.writeFileSync(_, g), console.log("Template rendered successfully"); })]; case 2: return l.sent(), [3, 4]; case 3: throw s = l.sent(), s; case 4: return [ 2 /*return*/ ]; } }); }); }, C = function(e, n, o) { var f, i = ""; if (e.file && e.file.name) { if (typeof e.file.name == "string") i = e.file.name; else if (typeof e.file.name == "object") { var r = e.file.name.case, t = e.file.name.argName, c = e.file.name.plural; t in n.arguments[r] ? i = c ? n.arguments.plural[r][t] : n.arguments[r][t] : (console.warn('Warning: The argument "'.concat(t, '" does not exist in the defined arguments.')), i = "undefined"); } } else i = "undefined"; for (var a = 0, s = o; a < s.length; a++) { var u = s[a], l = h.join(n.__dirname, "src/".concat(e.destinationPath, "/").concat(!((f = e.file) === null || f === void 0) && f.subDir ? i + "/" : "").concat(i, ".").concat(u)); v.writeFileSync(l, ""); } }; export { F as BaseCommand, q as __dirname, B as filename, L as getObjectFirstProperty, C as includeRelated, S as renderTemplate };