rtrouton / rtrouton_scripts

Scripts to share
MIT License
1.3k stars 489 forks source link

Not finding latest version of Command line tools #92

Closed dash4385 closed 10 months ago

dash4385 commented 2 years ago

install_xcode_command_line_tools keeps pulling the beta version of CLT for version 13 rather than the latest version 13.2

ryangball commented 2 years ago

Is the desired outcome that Beta versions are simply ignored?

dash4385 commented 2 years ago

Be great if there was a toggle to ignore or not. If ingoreBeta=True then ignore beta else get beta.

ryangball commented 2 years ago

I think that ignoreBeta="true" to ignore beta seems doable. However, I don't think you can always expect a beta to be available.

grahampugh commented 2 years ago

the problem I just had was that there were both the beta and regular versions available, and the output of the cmd_line_tools variable was therefore a two-liner:

Command Line Tools for Xcode-13.2
Command Line Tools beta 4 for Xcode-13.0: No such update

I was able to solve that this time by adding | head -n 1 to the mix, but who knows if that would be reliable. I suspect that if you add some sort of beta-selection variable, it will have to be a toggle: it either explicitly looks for a beta only, or it explicitly ignores that line. And still, probably worth a head -n 1 for good measure.

ryangball commented 2 years ago

@grahampugh I think my linked PR should be able to at least ignore betas if they are listed.