xcode-select copiable command
Reviewed By: ivanmisuno Differential Revision: D50383695 fbshipit-source-id: 094c0477e44180591b479468fd365959e485da8a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
683fbfd6fb
commit
b9952410b3
@@ -178,23 +178,32 @@ export function getHealthchecks(): FlipperDoctor.Healthchecks {
|
||||
isRequired: true,
|
||||
run: async (_: FlipperDoctor.EnvironmentInfo) => {
|
||||
const result = await tryExecuteCommand('xcode-select -p');
|
||||
const selectXcodeCommands = [
|
||||
{
|
||||
title: 'Select Xcode version',
|
||||
command: `sudo xcode-select -switch <path/to/>Xcode.app`,
|
||||
},
|
||||
];
|
||||
if (result.hasProblem) {
|
||||
return {
|
||||
hasProblem: true,
|
||||
message: `Xcode version is not selected. You can select it using command "sudo xcode-select -switch <path/to/>Xcode.app". ${result.message}.`,
|
||||
message: `Xcode version is not selected. ${result.message}.`,
|
||||
commands: selectXcodeCommands,
|
||||
};
|
||||
}
|
||||
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 <path/to/>Xcode.app".`,
|
||||
message: `xcode-select has no Xcode selected.`,
|
||||
commands: selectXcodeCommands,
|
||||
};
|
||||
}
|
||||
if ((await fs_extra.pathExists(selectedXcode)) == false) {
|
||||
return {
|
||||
hasProblem: true,
|
||||
message: `xcode-select has path of ${selectedXcode}, however this path does not exist on disk. Run "sudo xcode-select --switch" with a valid Xcode.app path.`,
|
||||
message: `xcode-select has path of ${selectedXcode}, however this path does not exist on disk.`,
|
||||
commands: selectXcodeCommands,
|
||||
};
|
||||
}
|
||||
const validatedXcodeVersion =
|
||||
|
||||
Reference in New Issue
Block a user