Skip to content

Commit

Permalink
homebrew_cleanup: don't fail on git fsck (#1160)
Browse files Browse the repository at this point in the history
The git fsck call is trying to improve reliability,
but it can fail if git from brew is broken. Since
this script is removing all installed formulae,
just continue if git fsck fails.

Signed-off-by: Steve Peters <[email protected]>
  • Loading branch information
scpeters authored Aug 13, 2024
1 parent 350e8ef commit 409e5c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jenkins-scripts/lib/_homebrew_cleanup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ restore_brew()

BREW_BINARY_DIR=/usr/local/bin
BREW_BINARY=${BREW_BINARY_DIR}/brew
git -C $(${BREW_BINARY} --repo) fsck
# Try running `git fsck` before `brew update` in case `git gc` broke something
# but don't fail
git -C $(${BREW_BINARY} --repo) fsck || true
export HOMEBREW_UPDATE_TO_TAG=1
${BREW_BINARY} up || { restore_brew && ${BREW_BINARY} up ; }

Expand Down

0 comments on commit 409e5c3

Please sign in to comment.