diff --git a/doctor/src/index.ts b/doctor/src/index.ts index 5a212dd14..b3c431469 100644 --- a/doctor/src/index.ts +++ b/doctor/src/index.ts @@ -9,6 +9,8 @@ import {getEnvInfo, EnvironmentInfo} from './environmentInfo'; export {getEnvInfo} from './environmentInfo'; +import {exec} from 'child_process'; +import {promisify} from 'util'; type HealthcheckCategory = { label: string; @@ -66,6 +68,15 @@ export function getHealthchecks(): Healthchecks { hasProblem: e.IDEs == null || e.IDEs.Xcode == null, }), }, + { + label: 'Is xcode-select set', + isRequired: true, + run: async (e: EnvironmentInfo) => ({ + hasProblem: + (await promisify(exec)('xcode-select -p')).stdout.trim() + .length < 1, + }), + }, ], }, }