70bf21e064
Handle Changesets / Handle Changesets (push) Waiting to run
Semgrep OSS scan / semgrep-oss (push) Waiting to run
Deploy (to testing) and Test Playground Preview Worker / Deploy Playground Preview Worker (testing) (push) Has been skipped
Deploy Workers Shared Staging / Deploy Workers Shared Staging (push) Failing after 0s
Prerelease / build (push) Has been skipped
18 lines
496 B
TypeScript
18 lines
496 B
TypeScript
import { rmSync } from "node:fs";
|
|
import { resolve } from "node:path";
|
|
|
|
/**
|
|
* Cross-platform recursive directory/file removal utility.
|
|
* Silently handles non-existent paths.
|
|
*/
|
|
export function clean(paths: string[]): void {
|
|
for (const p of paths) {
|
|
// eslint-disable-next-line workers-sdk/no-direct-recursive-rm -- clean tool intentionally removes build artifacts
|
|
rmSync(resolve(p), { recursive: true, force: true });
|
|
}
|
|
}
|
|
|
|
if (require.main === module) {
|
|
clean(process.argv.slice(2));
|
|
}
|