XcodesOrg / xcodes

The best command-line tool to install and switch between multiple versions of Xcode.
MIT License
3.68k stars 126 forks source link

Don't exit(1) on certain errors, when they're not true failures. #142

Closed tahirmt closed 2 years ago

tahirmt commented 3 years ago

Currently if I run xcodes install --latest the command fails if Xcode is already installed. Since it is already installed, do not fail the command

MattKiazyk commented 3 years ago

Hi @tahirmt

When I try that command - I'm getting:

xcodes install --latest
Updating...
Latest non-prerelease version available is 12.4
12.4 is already installed at /Applications/Xcode-12.4.0.app

Are you seeing something different?

tahirmt commented 3 years ago

@MattKiazyk Yes I see this but it exists after and doesn't continue. I have xcodes as part of a script that has other steps after this but xcodes exits my script because Xcode is already installed

MattKiazyk commented 3 years ago

Ah I see what you're meaning. Thanks for that. For sure we shouldn't be exiting hard in this scenario.

julianxhokaxhiu commented 3 years ago

I recently crossed exactly this issue and I was wondering if some progress have been done related.

In my own case this is the error:

$ xcodes install 12.4
12.4 is already installed at /Applications/Xcode-12.4.0.app
make: *** [Makefile:50: install_xcode_versions] Error 1

I could bypass this by adding || true at the moment, but I would be nice if you could maybe not exit with an error code > 0.

Thank you in advance!