From b1381d1d4630c5fb73517b78d68939663635311f Mon Sep 17 00:00:00 2001 From: Sudarshan Wadkar Date: Fri, 3 Apr 2020 00:55:54 +0530 Subject: [PATCH] Fix python-build `brew: command not found` error (#1544) This PR fixes (currently harmless) warning on macOS when homebrew is *not* installed. - [ ] Test case (required?) For example: ```sh wadkar$ pyenv install 3.8.2 /Users/wadkar/.pyenv/plugins/python-build/bin/python-build: line 1541: brew: command not found /Users/wadkar/.pyenv/plugins/python-build/bin/python-build: line 1541: brew: command not found Installing openssl-1.1.0j... Installed openssl-1.1.0j to /Users/wadkar/.pyenv/versions/3.8.2 Installing readline-8.0... Installed readline-8.0 to /Users/wadkar/.pyenv/versions/3.8.2 Installing Python-3.8.2... python-build: use zlib from xcode sdk Installed Python-3.8.2 to /Users/wadkar/.pyenv/versions/3.8.2 ``` --- plugins/python-build/bin/python-build | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index f5f29726..b5aa1ec4 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -1537,6 +1537,7 @@ has_broken_mac_openssl() { } use_homebrew_openssl() { + command -v brew >/dev/null || return 1 for openssl in ${PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA:-openssl}; do local ssldir="$(brew --prefix "${openssl}" || true)" if [ -d "$ssldir" ]; then