// 票 01 收尾:最终日志归位 fetch-all.log,清理中间轮日志与临时输出 import fs from 'node:fs'; const DIR = 'e:/code/crm-backend-matt/.scratch/opportunity-bugfix'; const ren = (a, b) => { if (fs.existsSync(`${DIR}/${a}`)) { fs.renameSync(`${DIR}/${a}`, `${DIR}/${b}`); console.log(`renamed ${a} -> ${b}`); } else console.log(`skip (missing): ${a}`); }; const rm = (f) => { if (fs.existsSync(`${DIR}/${f}`)) { fs.unlinkSync(`${DIR}/${f}`); console.log(`removed ${f}`); } else console.log(`skip (missing): ${f}`); }; rm('fetch-all.log'); // 旧首轮日志,给最终轮让位 ren('fetch-all4.log', 'fetch-all.log'); for (const f of ['fetch-test1.log', 'fetch-all2.log', 'fetch-all3.log', 'diff-files.log', 'diff-files2.log', 'diff-files3.log', 'sitemap-out.txt', 'lanhu-pages-inspect.txt', 'a1x-1-1.html']) rm(f);