build: remove stale backend distribution files

This commit is contained in:
2026-08-10 22:34:03 +02:00
parent ab315c2130
commit fc19b0d67c
4 changed files with 172 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
import { rm } from "node:fs/promises";
import { basename, dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
const scriptDirectory = dirname(fileURLToPath(import.meta.url));
const backendRoot = resolve(scriptDirectory, "..");
const target = resolve(backendRoot, "dist");
if (dirname(target) !== backendRoot || basename(target) !== "dist") {
throw new Error(`Refusing to clean non-dist target: ${target}`);
}
await rm(target, { recursive: true, force: true });