Initial commit

This commit is contained in:
Diego Marcos
2025-05-23 08:52:14 -07:00
committed by Diego Marcos Segura
commit 3332f609a9
129 changed files with 64575 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
import fs from "node:fs";
import { copyFile, mkdir, rename } from "node:fs/promises";
import path from "node:path";
function copyDir(src, dest) {
if (!fs.existsSync(dest)) {
fs.mkdirSync(dest, { recursive: true });
}
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
const srcPath = path.join(src, entry.name);
const destPath = path.join(dest, entry.name);
if (entry.isDirectory()) {
copyDir(srcPath, destPath);
} else {
fs.copyFileSync(srcPath, destPath);
}
}
}
// Example usage:
const sourceDir = "examples";
const destinationDir = "site/examples";
copyDir("examples", "site/examples");
await copyFile("index.html", "site/examples/index.html");
await rename("site/examples/viewer", "site/viewer");
await mkdir("site/examples/vendor", { recursive: true });
copyDir("node_modules/three", "site/examples/js/vendor/three");
copyDir("dist", "site/dist");
console.log("Site generated in site directory.");