Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward legible errors #143

Merged
merged 1 commit into from
Jun 8, 2021
Merged

Forward legible errors #143

merged 1 commit into from
Jun 8, 2021

Conversation

ffittschen
Copy link
Contributor

I'm currently trying to uninstall Xcode 12.5 Beta 3 using xcodes, but it fails with the following error:

$ xcodes uninstall 12.5 Beta 3
The operation couldn’t be completed. (ExitCode(rawValue: 1))

Upon investigating the cause, I discovered that the error is not correctly forwarded, which is why I can't see the real error message. This PR fixes that and forwards the catched errors.

@ffittschen ffittschen requested a review from a team as a code owner April 22, 2021 15:27
@MattKiazyk
Copy link
Contributor

Thanks for the PR @ffittschen - I'm curious what the result was on your machine with that change?

@ffittschen
Copy link
Contributor Author

ffittschen commented Apr 22, 2021

I didn't see the result, but I figured out the issue:

We are using xcodes within ansible playbooks to manage our Xcode installations on the CI machines. As the xcodes install command interactively asks for a password, we run the command using become: true to avoid this. As it turns out, subsequently calling xcodes uninstall without become: true results in the error I posted above. But when I add become: true to the uninstall call, the Xcode.app is actually moved to /private/var/root/.Trash/ instead of ~/.Trash/. As a workaround I added an "Empty trash" task after the uninstall task, which is not great 😄 Ideally, the xcodes uninstall command would have a --force option to avoid the empty trash step, but that's another topic and I'll open an issue for that to discuss it 🙂

Do you happen to have any suggestions on how to run xcodes install / uninstall without sudo or become: true in a non-interactive way?

@MattKiazyk MattKiazyk merged commit f2b92c4 into XcodesOrg:main Jun 8, 2021
@MattKiazyk
Copy link
Contributor

@ffittschen I'm going to merge this in and release it. If you want - can you open up an issue to talk about the other issue you've brought up.

Thanks for the PR - sorry it took so long to get through

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants