clean-lock.js 397 B

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