()
| 29 | |
| 30 | // 检查是否需要初始化数据库 |
| 31 | async function needsInit() { |
| 32 | const dataDir = path.join(process.cwd(), 'data'); |
| 33 | |
| 34 | // 如果data目录不存在,需要初始化 |
| 35 | if (!fs.existsSync(dataDir)) { |
| 36 | return true; |
| 37 | } |
| 38 | |
| 39 | // 使用专门的数据库检查器 |
| 40 | const isReady = await isDatabaseReady(); |
| 41 | return !isReady; |
| 42 | } |
| 43 | |
| 44 | // 执行命令并显示输出 |
| 45 | function runCommand(command, description) { |
no test coverage detected