Function
getCommandOutput
(error: unknown, key: 'stdout' | 'stderr')
Source from the content-addressed store, hash-verified
| 128 | } |
| 129 | |
| 130 | function getCommandOutput(error: unknown, key: 'stdout' | 'stderr'): string { |
| 131 | const output = (error as Partial<SpawnSyncReturns<Buffer>> | null)?.[key]; |
| 132 | if (!output) return ''; |
| 133 | return Buffer.isBuffer(output) ? output.toString('utf-8').trim() : String(output).trim(); |
| 134 | } |
| 135 | |
| 136 | /** 确保数据库 schema 与当前版本一致 */ |
| 137 | function ensureDatabase(dataDir: string, dbPath: string, schemaPath: string) { |
Tested by
no test coverage detected