Skip to content

Commit

Permalink
provide full command to run for xcode-select
Browse files Browse the repository at this point in the history
Reviewed By: passy

Differential Revision: D57724432

fbshipit-source-id: 94aeeed2005c2318ffcf5850c85e08f123c70879
  • Loading branch information
antonk52 authored and facebook-github-bot committed May 23, 2024
1 parent 9f34504 commit 93f378c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
7 changes: 6 additions & 1 deletion desktop/flipper-common/src/doctor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,12 @@ export namespace FlipperDoctor {
'ios.xcode-select--not_set': [{message: string}];
'ios.xcode-select--no_xcode_selected': [];
'ios.xcode-select--noop': [];
'ios.xcode-select--custom_path': [];
'ios.xcode-select--custom_path': [
{
selectedPath: string;
availableXcode: string | null;
},
];
'ios.xcode-select--old_version_selected': [
{
selectedVersion: string;
Expand Down
15 changes: 14 additions & 1 deletion desktop/flipper-ui/src/sandy-chrome/doctor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,19 @@ const XcodeSelectNoXcode = (
</Typography.Paragraph>
);

const XcodeSelectCustomPath = (
props: PropsFor<'ios.xcode-select--custom_path'>,
) => (
<Typography.Paragraph>
Selected path is not a Xcode application:
<CodeBlock size="s">{props.selectedPath}</CodeBlock>
<CliCommand
title="Select existing Xcode application"
command={`sudo xcode-select -switch ${props.availableXcode ?? '<path/to/>/Xcode.app'}`}
/>
</Typography.Paragraph>
);

const XcodeSelectNonExistingSelected = (
props: PropsFor<'ios.xcode-select--nonexisting_selected'>,
) => (
Expand Down Expand Up @@ -335,7 +348,7 @@ const messageToComp: {
'ios.xcode-select--no_xcode_selected': XcodeSelectNoXcode,
'ios.xcode-select--nonexisting_selected': XcodeSelectNonExistingSelected,
'ios.xcode-select--noop': Noop,
'ios.xcode-select--custom_path': Noop,
'ios.xcode-select--custom_path': XcodeSelectCustomPath,
'ios.xcode-select--old_version_selected': Noop,

'ios.sdk--installed': IosSdkInstalled,
Expand Down

0 comments on commit 93f378c

Please sign in to comment.