Files
bdrp-admin/scripts/clean.mjs
liangzai e91a8f8664
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled
first commit
2026-04-01 15:45:43 +08:00

27 lines
671 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 精简版清理:.turbo、根 node_modules/.cache可选 --del-lock 删除 pnpm-lock.yaml
*/
import { existsSync, rmSync } from 'node:fs';
import path from 'node:path';
import process from 'node:process';
const root = process.cwd();
const delLock = process.argv.includes('--del-lock');
const paths = ['.turbo', path.join(root, 'node_modules/.cache')];
for (const p of paths) {
if (existsSync(p)) {
rmSync(p, { recursive: true, force: true });
console.log('removed', p);
}
}
if (delLock) {
const lockfile = path.join(root, 'pnpm-lock.yaml');
if (existsSync(lockfile)) {
rmSync(lockfile);
console.log('removed pnpm-lock.yaml');
}
}