Actually use unit tested function in wrapped xcode check
Summary: Accidentally tested a function that should have been called from the internals. This makes the internal function use the check. Reviewed By: lblasa Differential Revision: D34139589 fbshipit-source-id: fac13f7b54ffb0b6f501fb9237f55766706e975a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3871755064
commit
84fac685ac
@@ -192,29 +192,28 @@ export class IOSDeviceManager {
|
|||||||
|
|
||||||
async checkXcodeVersionMismatch() {
|
async checkXcodeVersionMismatch() {
|
||||||
try {
|
try {
|
||||||
let {stdout: xcodeCLIVersion} = await exec('xcode-select -p');
|
const {stdout: xcodeSelectStdout} = await exec('xcode-select -p');
|
||||||
xcodeCLIVersion = xcodeCLIVersion!.toString().trim();
|
const xcodeCLIVersion = xcodeSelectStdout!.toString().trim();
|
||||||
const {stdout} = await exec(
|
const {stdout: simulatorProcessStdout} = await exec(
|
||||||
"pgrep Simulator | xargs ps -o command | grep -v grep | grep Simulator.app | awk '{print $1}'",
|
"pgrep Simulator | xargs ps -o command | grep -v grep | grep Simulator.app | awk '{print $1}'",
|
||||||
);
|
);
|
||||||
for (const runningSimulatorApp of stdout!.toString().split('\n')) {
|
const runningSimulatorApplications = simulatorProcessStdout!
|
||||||
if (!runningSimulatorApp) {
|
.toString()
|
||||||
continue;
|
.split('\n')
|
||||||
}
|
.filter((application) => application.length > 0);
|
||||||
if (runningSimulatorApp.startsWith(xcodeCLIVersion)) {
|
const mismatchedVersion = checkXcodeVersionMismatch(
|
||||||
continue;
|
runningSimulatorApplications,
|
||||||
}
|
xcodeCLIVersion,
|
||||||
const runningVersion =
|
);
|
||||||
runningSimulatorApp.split('/Contents/Developer')[0] +
|
if (mismatchedVersion === undefined) {
|
||||||
'/Contents/Developer';
|
return;
|
||||||
const errorMessage = `Xcode version mismatch: Simulator is running from "${runningVersion}" while Xcode CLI is "${xcodeCLIVersion}". Running "xcode-select --switch ${runningVersion}" can fix this. For example: "sudo xcode-select -s /Applications/Xcode.app/Contents/Developer"`;
|
|
||||||
this.flipperServer.emit('notification', {
|
|
||||||
type: 'error',
|
|
||||||
title: 'Xcode version mismatch',
|
|
||||||
description: '' + errorMessage,
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
const errorMessage = `Xcode version mismatch: Simulator is running from "${mismatchedVersion}" while Xcode CLI is "${xcodeCLIVersion}". Running "xcode-select --switch ${xcodeCLIVersion}" can fix this. For example: "sudo xcode-select -s /Applications/Xcode.app/Contents/Developer"`;
|
||||||
|
this.flipperServer.emit('notification', {
|
||||||
|
type: 'error',
|
||||||
|
title: 'Xcode version mismatch',
|
||||||
|
description: '' + errorMessage,
|
||||||
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Failed to determine Xcode version:', e);
|
console.error('Failed to determine Xcode version:', e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user