-
zhangwei
1 天以前 2f5177b8a553bdc468cc68a20029916f59d1b4f1
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}`);
    }
});