forked from BeOnAuto/auto-engineer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean.ts
More file actions
28 lines (25 loc) · 815 Bytes
/
clean.ts
File metadata and controls
28 lines (25 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env tsx
import { execSync } from 'child_process';
const commands = [
'rm -rf node_modules',
'rm -rf packages/*/node_modules',
'rm -rf apps/*/node_modules',
'rm -rf .pnpm-store',
'find . -type d -name "node_modules" -exec rm -rf {} +',
'find . -type d -name "dist" -exec rm -rf {} +',
'find . -type d -name ".turbo" -exec rm -rf {} +',
'find . -type d -name "coverage" -exec rm -rf {} +',
'find . -type d -name ".next" -exec rm -rf {} +',
'find . -type d -name "build" -exec rm -rf {} +',
'find . -name "*.tsbuildinfo" -delete',
'find . -type d -name ".cache" -exec rm -rf {} +',
'pnpm install',
];
commands.forEach((cmd) => {
try {
execSync(cmd, { stdio: 'inherit' });
} catch (err) {
console.error(`Failed to execute: ${cmd}`, err);
process.exit(1);
}
});