()
| 68 | return logs.map(v => v.trim()).join('\n'); |
| 69 | }; |
| 70 | const getOldLog = async () => { |
| 71 | const log = await readFile(FILES.chlog, enc); |
| 72 | const idx = log.indexOf('#'); |
| 73 | return [ |
| 74 | log.slice(0, idx), |
| 75 | log.slice(idx), |
| 76 | ]; |
| 77 | }; |
| 78 | const [newLog, [logHead, oldLog]] = await Promise.all([ getNewLog(), getOldLog() ]); |
| 79 | return `${logHead}# ${newver}\n${newLog}\n\n${oldLog}`; |
| 80 |