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

Function handleDoctor

apps/kimi-code/src/cli/sub/doctor.ts:65–79  ·  view source on GitHub ↗
(deps: DoctorDeps, options: DoctorOptions)

Source from the content-addressed store, hash-verified

63}
64
65export async function handleDoctor(deps: DoctorDeps, options: DoctorOptions): Promise<number> {
66 const resolved = resolveDeps(deps);
67 const cwd = resolved.cwd();
68 const specs = await buildCheckSpecs(resolved, options, cwd);
69 const results = await Promise.all(specs.map((spec) => checkTomlFile(resolved, spec)));
70
71 const issueCount = results.filter((result) => result.status === 'ERROR').length;
72 const text = issueCount === 0 ? formatSuccess(results) : formatFailure(results, issueCount);
73 if (issueCount === 0) {
74 resolved.stdout.write(text);
75 } else {
76 resolved.stderr.write(text);
77 }
78 return issueCount === 0 ? 0 : 1;
79}
80
81export function registerDoctorCommand(parent: Command, deps?: Partial<DoctorDeps>): void {
82 const doctor = parent

Callers 2

doctor.test.tsFile · 0.90
runDoctorCommandFunction · 0.85

Calls 7

buildCheckSpecsFunction · 0.85
checkTomlFileFunction · 0.85
formatSuccessFunction · 0.85
formatFailureFunction · 0.85
cwdMethod · 0.80
resolveDepsFunction · 0.70
writeMethod · 0.65

Tested by

no test coverage detected