Binato/tooling/cleanup.ts
2023-10-05 11:13:19 +01:00

11 lines
No EOL
324 B
TypeScript

import { readdirSync, rmSync, readFileSync } from "fs";
const libFiles = readdirSync("./build");
const mangled = readFileSync("./build/.MANGLED").toString() === "false";
for (const file of libFiles) {
if (!file.startsWith(mangled ? "Binato.min.js" : "Binato.js")) {
rmSync(`./build/${file}`, { recursive: true });
}
}