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
27 lines
671 B
JavaScript
27 lines
671 B
JavaScript
/**
|
||
* 精简版清理:.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');
|
||
}
|
||
}
|