diff --git a/desktop/doctor/src/index.tsx b/desktop/doctor/src/index.tsx index 35991f2ea..b5661855a 100644 --- a/desktop/doctor/src/index.tsx +++ b/desktop/doctor/src/index.tsx @@ -175,13 +175,22 @@ export function getHealthchecks(): FlipperDoctor.Healthchecks { isRequired: true, run: async (_: FlipperDoctor.EnvironmentInfo) => { const result = await tryExecuteCommand('xcode-select -p'); - const hasProblem = result.hasProblem; - const message = hasProblem - ? `Xcode version is not selected. You can select it using command "sudo xcode-select -switch Xcode.app". ${result.message}.` - : `Xcode version is selected. ${result.message}.`; + if (result.hasProblem) { + return { + hasProblem: true, + message: `Xcode version is not selected. You can select it using command "sudo xcode-select -switch Xcode.app". ${result.message}.`, + }; + } + const selectedXcode = result.stdout!.toString().trim(); + if (selectedXcode == '/Library/Developer/CommandLineTools') { + return { + hasProblem: true, + message: `xcode-select has no Xcode selected, You can select it using command "sudo xcode-select -switch Xcode.app".`, + }; + } return { - hasProblem, - message, + hasProblem: false, + message: `xcode-select has path of ${selectedXcode}.`, }; }, }, @@ -290,12 +299,13 @@ export async function runHealthchecks(): Promise< async function tryExecuteCommand( command: string, -): Promise { +): Promise { try { const output = await promisify(exec)(command); return { hasProblem: false, message: `Command "${command}" successfully executed with output: ${output.stdout}`, + stdout: output.stdout, }; } catch (err) { return { diff --git a/desktop/flipper-common/src/doctor.tsx b/desktop/flipper-common/src/doctor.tsx index 0c4f3aea4..aabb07728 100644 --- a/desktop/flipper-common/src/doctor.tsx +++ b/desktop/flipper-common/src/doctor.tsx @@ -69,6 +69,10 @@ export namespace FlipperDoctor { message: string; }; + export type SubprocessHealtcheckRunResult = HealthcheckRunResult & { + stdout?: string; + }; + export type CategoryResult = [ string, {