1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| // clean.js
| import fs from 'fs';
| import path from 'path';
|
| const filesToDelete = ['pnpm-lock.yaml', 'package-lock.json'];
|
| // 删除文件
| filesToDelete.forEach((file) => {
| const filePath = path.join(process.cwd(), file);
| if (fs.existsSync(filePath)) {
| fs.unlinkSync(filePath);
| console.log(`Deleted file: ${filePath}`);
| } else {
| console.log(`File not found: ${filePath}`);
| }
| });
|
|