tcp-ws-proxy/tooling/cleanup.ts

11 lines
322 B
TypeScript
Raw Normal View History

2024-01-18 14:48:09 +00:00
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 ? "index.min.js" : "index.js")) {
rmSync(`./build/${file}`, { recursive: true });
}
}