support test brew stub

This commit is contained in:
Ivan Pozdeev 2025-05-08 17:07:17 +03:00
parent 081325a481
commit 83ce1df72d

View File

@ -134,7 +134,11 @@ can_use_homebrew() {
is_mac && command -v brew &>/dev/null && return 0
# In Linux, if Pyenv itself is installed with Homebrew,
# we assume the user wants to take dependencies from there as well by default
command -v brew &>/dev/null && [[ $(abs_dirname "${BASH_SOURCE}") == "$(abs_dirname "$(brew --prefix)")"/* ]] &&
local brew_prefix
command -v brew &>/dev/null && \
# tests can have non-functional `brew' stub aliased to `false'
brew_prefix="$(brew --prefix)" &&
[[ $(abs_dirname "${BASH_SOURCE}") == "$(abs_dirname "${brew_prefix}")"/* ]] &&
{ lock_in homebrew; return 0; }
# do not check the same stuff multiple times