(deps: DoctorDeps, options: DoctorOptions)
| 63 | } |
| 64 | |
| 65 | export 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 | |
| 81 | export function registerDoctorCommand(parent: Command, deps?: Partial<DoctorDeps>): void { |
| 82 | const doctor = parent |
no test coverage detected