(exitMsgs: ExitMessageData[])
| 280 | await fs.mkdir(path.dirname(EXIT_MSG_FILE_PATH), { recursive: true }); |
| 281 | await fs.writeFile( |
| 282 | EXIT_MSG_FILE_PATH, |
| 283 | JSON.stringify(exitMsgs, null, 2) |
| 284 | ); |
| 285 | } catch (error) { |
| 286 | console.error("[autodelcmd] 保存退出消息失败:", error); |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | private async clearExitMessages() { |
| 291 | try { |
| 292 | await fs.unlink(EXIT_MSG_FILE_PATH); |
| 293 | } catch (error) { |
| 294 | // 文件不存在时忽略错误 |
| 295 | if (error.code !== 'ENOENT') { |
no test coverage detected