Skip to content

Commit

Permalink
brew.sh: improve HOMEBREW_FORCE_BREW_WRAPPER error message
Browse files Browse the repository at this point in the history
Rather than just explaining what is happening, let's explain a bit more
why this is happening and how to fix it.
  • Loading branch information
MikeMcQuaid committed Feb 7, 2025
1 parent fe7c761 commit 13e5597
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions Library/Homebrew/brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,24 +189,30 @@ then
if [[ -z "${HOMEBREW_BREW_WRAPPER:-}" ]]
then
odie <<EOS
HOMEBREW_FORCE_BREW_WRAPPER was set to
${HOMEBREW_FORCE_BREW_WRAPPER}
but HOMEBREW_BREW_WRAPPER was unset. This indicates that you are running
${HOMEBREW_BREW_FILE}
directly but should instead run
${HOMEBREW_FORCE_BREW_WRAPPER}
conflicting Homebrew wrapper configuration!
HOMEBREW_FORCE_BREW_WRAPPER was set to ${HOMEBREW_FORCE_BREW_WRAPPER}
but HOMEBREW_BREW_WRAPPER was unset.
Ensure you run $(bold "${HOMEBREW_FORCE_BREW_WRAPPER}") directly (not ${HOMEBREW_BREW_FILE})
Manually setting your PATH can interfere with Homebrew wrappers.
Ensure your shell configuration contains:
eval "\$(${HOMEBREW_BREW_FILE} shellenv)"
or that $(bold "${HOMEBREW_FORCE_BREW_WRAPPER}") comes before ${HOMEBREW_BREW_FILE} in your PATH.
EOS
elif [[ "${HOMEBREW_FORCE_BREW_WRAPPER}" != "${HOMEBREW_BREW_WRAPPER}" ]]
then
odie <<EOS
HOMEBREW_FORCE_BREW_WRAPPER was set to
${HOMEBREW_FORCE_BREW_WRAPPER}
but HOMEBREW_BREW_WRAPPER was set to
${HOMEBREW_BREW_WRAPPER}
This indicates that you are running
${HOMEBREW_BREW_FILE}
directly but should instead run:
${HOMEBREW_FORCE_BREW_WRAPPER}
conflicting Homebrew wrapper configuration!
HOMEBREW_FORCE_BREW_WRAPPER was set to ${HOMEBREW_FORCE_BREW_WRAPPER}
but HOMEBREW_BREW_WRAPPER was set to ${HOMEBREW_BREW_WRAPPER}
Ensure you run $(bold "${HOMEBREW_FORCE_BREW_WRAPPER}") directly (not ${HOMEBREW_BREW_FILE})
Manually setting your PATH can interfere with Homebrew wrappers.
Ensure your shell configuration contains:
eval "\$(${HOMEBREW_BREW_FILE} shellenv)"
or that $(bold "${HOMEBREW_FORCE_BREW_WRAPPER}") comes before ${HOMEBREW_BREW_FILE} in your PATH.
EOS
fi
fi
Expand Down

0 comments on commit 13e5597

Please sign in to comment.