(filePath: string, maxLines: number)
| 388 | } |
| 389 | |
| 390 | function tailFile(filePath: string, maxLines: number): string { |
| 391 | try { |
| 392 | const content = readFileSync(filePath, 'utf8'); |
| 393 | const lines = content.split('\n').filter((line) => line.length > 0); |
| 394 | return lines.slice(-maxLines).join('\n'); |
| 395 | } catch { |
| 396 | return ''; |
| 397 | } |
| 398 | } |