Files
paseo/scripts/clean-package-dist.mjs
Mohamed Boudra 31ae545289 Group and clear workspace status in the sidebar (#1317)
* Add status grouping to the workspace sidebar

* Mark workspaces as read from the sidebar

* Clean package builds before release checks

* Fix sidebar status follow-up checks
2026-06-04 01:20:20 +08:00

18 lines
601 B
JavaScript

import { rmSync } from "node:fs";
import { basename, dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
const packageRoot = resolve(process.cwd());
const distPath = resolve(packageRoot, "dist");
if (packageRoot === repoRoot) {
throw new Error("Refusing to clean dist from the repository root");
}
if (dirname(distPath) !== packageRoot || basename(distPath) !== "dist") {
throw new Error(`Refusing to clean unexpected path: ${distPath}`);
}
rmSync(distPath, { recursive: true, force: true });