Skip to content

Commit

Permalink
feat(ios): show simulator version in prompt (#2214)
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonrybczak authored Dec 18, 2023
1 parent 085b045 commit 1e6ea84
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions packages/cli-platform-ios/src/tools/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,22 @@ export async function promptForDeviceSelection(
message: 'Select the device you want to use',
choices: availableDevices
.filter((d) => d.type === 'device' || d.type === 'simulator')
.map((d) => ({
title: `${chalk.bold(d.name)} ${
.map((d) => {
const version = d.version
? ` (${d.version.match(/^(\d+\.\d+)/)?.[1]})`
: '';

const availability =
!d.isAvailable && !!d.availabilityError
? chalk.red(`(unavailable - ${d.availabilityError})`)
: ''
}`,
value: d,
disabled: !d.isAvailable,
})),
: '';

return {
title: `${chalk.bold(`${d.name}${version}`)} ${availability}`,
value: d,
disabled: !d.isAvailable,
};
}),
min: 1,
});
return device;
Expand Down

0 comments on commit 1e6ea84

Please sign in to comment.