OSRFUNIXBase: brew remove git if it is corrupted #696
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
macOS has a system version of
git
at/usr/bin/git
, but sometimesbrew
installs a version ofgit
at/usr/local/bin/git
. Sometimes thebrew
version ofgit
can be broken if one of its dependencies, such asgettext
is missing or broken, as was recently noticed with glados:which I can trace back to an aborted build:
This is a hacky attempt to recover from this problem by trying to
brew remove
git and its dependencies ifgit --version
fails. My first test from this branch successfully removedgit
, but it failed on the subsequentgit clone
becausebash
's hash table was expectinggit
to be in/usr/local/bin/git
. I suppose we could add&& brew install git
to the end of this new line as well?