Check xcode-select is set

Summary:
Basic check for some xcode-path

There'll be a separate connected device check that looks at the current simulators and sees if they are running the same xcode version.

Reviewed By: mweststrate

Differential Revision: D18427090

fbshipit-source-id: 5e202d8920cae1ffce444e81a0c138a97936f758
This commit is contained in:
John Knox
2019-11-12 06:53:57 -08:00
committed by Facebook Github Bot
parent 1750516250
commit 55cfe11e2c

View File

@@ -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,
}),
},
],
},
}