xcode-install icon indicating copy to clipboard operation
xcode-install copied to clipboard

filter xcversion list by range of versions

Open Pe-te opened this issue 3 years ago • 5 comments

Hi, I'd like to always have all versions from Xcode 10 upwards installed, so I use this regex to find the missing ones:

xcversion list | grep -E '^[0-9]{2,}(.[0-9]+)*$'

But it would be really great, if we could have those as parameters for the list command instead:

  • Minimum version, usually we don't care about very old versions (I use two digits at the beginning for 10 and higher, but one day I might want to install something like 14 and higher)
  • Maybe even maximum version, if you have a build server that only handles old apps
  • Skipping all the "beta|seed|candidate|installed" versions (I do this by parsing for digits and dots only)
  • Skipping all already installed versions, we only want to know what is missing so we can install it

Pe-te avatar Apr 20 '21 13:04 Pe-te

I like this a lot! Perhaps using semantic versioning to compare versions 👌

Feel free to submit a pull request to implement this improvement 👍

rogerluan avatar Apr 20 '21 13:04 rogerluan

Feel free to submit a pull request to implement this improvement 👍

Awesome, my ruby-fu is just not strong enough. 😢 Hopefully someone can make this happen.

Pe-te avatar Apr 22 '21 10:04 Pe-te

As far as I understand the code, Tony Li added the missing option? How do we get it into master?

Pe-te avatar Jun 13 '22 08:06 Pe-te

@Pe-te , we'd need a PR to be open containing @crazytonyli's changes so we can review, test and merge them 😊

rogerluan avatar Jun 20 '22 20:06 rogerluan

FYI, I've opened a PR here: https://github.com/xcpretty/xcode-install/pull/438

crazytonyli avatar Jun 20 '22 21:06 crazytonyli