utils/wrapper.sh: fix source calls

We need to `source utils/helpers.sh` before calling `odie`. We also
don't need to `source utils/wrapper.sh` again here, because we are
already in `utils/wrapper.sh`.
This commit is contained in:
Carlo Cabrera 2025-08-19 12:21:03 +08:00 committed by Carlo Cabrera
parent 2dfc1b4eb8
commit 17435f583f
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -61,13 +61,13 @@ check-brew-wrapper() {
if ((HOMEBREW_BREW_CALLER_CHECK_EXIT_CODE != 0)) if ((HOMEBREW_BREW_CALLER_CHECK_EXIT_CODE != 0))
then then
source "${HOMEBREW_LIBRARY}/Homebrew/utils/helpers.sh"
# Error message already printed above when populating `HOMEBREW_BREW_CALLER`. # Error message already printed above when populating `HOMEBREW_BREW_CALLER`.
odie "failed to check the path to the parent process!" odie "failed to check the path to the parent process!"
fi fi
if [[ "${HOMEBREW_BREW_CALLER:-}" != "${HOMEBREW_FORCE_BREW_WRAPPER}" ]] if [[ "${HOMEBREW_BREW_CALLER:-}" != "${HOMEBREW_FORCE_BREW_WRAPPER}" ]]
then then
source "${HOMEBREW_LIBRARY}/Homebrew/utils/wrapper.sh"
odie-with-wrapper-message "but \`brew\` was invoked by ${HOMEBREW_BREW_CALLER}." odie-with-wrapper-message "but \`brew\` was invoked by ${HOMEBREW_BREW_CALLER}."
fi fi
fi fi