@maizzle/framework
Version:
Maizzle is a framework that helps you quickly build HTML emails with Tailwind CSS.
32 lines (31 loc) • 892 B
JavaScript
import { onCancel, scaffold } from "./scaffold.mjs";
import color from "picocolors";
import * as p from "@clack/prompts";
//#region src/commands/make/template.ts
async function makeTemplate(filePath) {
if (filePath) {
await scaffold(filePath, "template.vue");
return;
}
p.intro(`${color.bgCyan(color.black(" maizzle make:template "))}`);
const result = await p.group({
filename: () => p.text({
message: "File name",
placeholder: "welcome.vue",
validate: (value) => {
if (!value) return "Please enter a file name.";
}
}),
path: () => p.text({
message: "Directory to place it in",
placeholder: "./emails",
initialValue: "./emails",
validate: (value) => {
if (!value) return "Please enter a path.";
}
})
}, { onCancel });
await scaffold(`${result.path}/${result.filename}`, "template.vue");
}
//#endregion
export { makeTemplate as default };