mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
* 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
18 lines
601 B
JavaScript
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 });
|