zhangwei
3 天以前 019b6cf4ccaa06fc5ca8f5dc5663975eb027d360
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}`);
    }
});