MCPcopy Create free account
hub / github.com/tiann/hapi / getLogFiles

Function getLogFiles

cli/src/ui/doctor.ts:50–67  ·  view source on GitHub ↗
(logDir: string)

Source from the content-addressed store, hash-verified

48}
49
50function getLogFiles(logDir: string): { file: string, path: string, modified: Date }[] {
51 if (!existsSync(logDir)) {
52 return [];
53 }
54
55 try {
56 return readdirSync(logDir)
57 .filter(file => file.endsWith('.log'))
58 .map(file => {
59 const path = join(logDir, file);
60 const stats = statSync(path);
61 return { file, path, modified: stats.mtime };
62 })
63 .sort((a, b) => b.modified.getTime() - a.modified.getTime());
64 } catch {
65 return [];
66 }
67}
68
69/**
70 * Run doctor command specifically for runner diagnostics

Callers 1

runDoctorCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected