()
| 17 | } |
| 18 | |
| 19 | async function runDoctor(): Promise<void> { |
| 20 | try { |
| 21 | // Using console.error to avoid linting issues as it's allowed by the project's linting rules |
| 22 | console.error(`Running XcodeBuildMCP Doctor (v${version})...`); |
| 23 | console.error('Collecting system information and checking dependencies...\n'); |
| 24 | |
| 25 | await bootstrapRuntime({ runtime: 'cli' }); |
| 26 | |
| 27 | const nonRedacted = shouldUseNonRedactedOutput(process.argv.slice(2)); |
| 28 | if (nonRedacted) { |
| 29 | console.error( |
| 30 | 'Warning: --non-redacted is enabled; doctor output may include sensitive data.', |
| 31 | ); |
| 32 | } |
| 33 | |
| 34 | const executor = getDefaultCommandExecutor(); |
| 35 | const result = await doctorLogic({ nonRedacted }, executor); |
| 36 | |
| 37 | if (result.content && result.content.length > 0) { |
| 38 | const textContent = result.content.find((item) => item.type === 'text'); |
| 39 | if (textContent?.type === 'text') { |
| 40 | // eslint-disable-next-line no-console |
| 41 | console.log(textContent.text); |
| 42 | } else { |
| 43 | console.error('Error: Unexpected doctor result format'); |
| 44 | } |
| 45 | } else { |
| 46 | console.error('Error: No doctor information returned'); |
| 47 | } |
| 48 | |
| 49 | console.error('\nDoctor run complete. Please include this output when reporting issues.'); |
| 50 | } catch (error) { |
| 51 | console.error('Error running doctor:', error); |
| 52 | process.exit(1); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | // Run the doctor |
| 57 | runDoctor().catch((error) => { |
no test coverage detected