@ordino.ai/cli
Version:
ordino.ai global command line interface
24 lines (19 loc) • 756 B
text/typescript
import path from "path";
import fs from "fs";
function createMicrofrontendBoilerplate(appPath: string, projectName: string) {
const templateDir = path.join(__dirname, "../../templates/microfrontend");
copyTemplateFiles(templateDir, appPath);
}
function copyTemplateFiles(templateDir: string, destinationDir: string) {
fs.readdirSync(templateDir, { withFileTypes: true }).forEach((entry) => {
const srcPath = path.join(templateDir, entry.name);
const destPath = path.join(destinationDir, entry.name);
if (entry.isDirectory()) {
fs.mkdirSync(destPath, { recursive: true });
copyTemplateFiles(srcPath, destPath);
} else {
fs.copyFileSync(srcPath, destPath);
}
});
}
export { createMicrofrontendBoilerplate };