Add valid path check for xcode-select'd Xcode
Summary: We should also check that Xcode exists at the path that the user has `xcode-select`'d Reviewed By: passy Differential Revision: D34168672 fbshipit-source-id: dc7c36bcb2ad1cec99e6ebb4d531417e55402f01
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ef2b03ea95
commit
fbd3212994
@@ -27,6 +27,7 @@
|
|||||||
"author": "Facebook, Inc",
|
"author": "Facebook, Inc",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"envinfo": "^7.8.1",
|
"envinfo": "^7.8.1",
|
||||||
"fb-watchman": "^2.0.1"
|
"fb-watchman": "^2.0.1",
|
||||||
|
"fs-extra": "^10.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import * as watchman from 'fb-watchman';
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import type {FlipperDoctor} from 'flipper-common';
|
import type {FlipperDoctor} from 'flipper-common';
|
||||||
|
import * as fs_extra from 'fs-extra';
|
||||||
|
|
||||||
export function getHealthchecks(): FlipperDoctor.Healthchecks {
|
export function getHealthchecks(): FlipperDoctor.Healthchecks {
|
||||||
return {
|
return {
|
||||||
@@ -188,6 +189,12 @@ export function getHealthchecks(): FlipperDoctor.Healthchecks {
|
|||||||
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, You can select it using command "sudo xcode-select -switch <path/to/>Xcode.app".`,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
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.`,
|
||||||
|
};
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
hasProblem: false,
|
hasProblem: false,
|
||||||
message: `xcode-select has path of ${selectedXcode}.`,
|
message: `xcode-select has path of ${selectedXcode}.`,
|
||||||
|
|||||||
Reference in New Issue
Block a user