MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / tailFile

Function tailFile

apps/kimi-code/src/cli/sub/server/daemon.ts:390–398  ·  view source on GitHub ↗
(filePath: string, maxLines: number)

Source from the content-addressed store, hash-verified

388}
389
390function 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}

Callers 1

formatLogTailFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected