cmd/--version: don't always output homebrew/core.

This is more confusing than helpful if it's untapped for API usage.
This commit is contained in:
Mike McQuaid 2023-02-17 13:39:57 +00:00
parent abc6d22623
commit d60d2fe158
No known key found for this signature in database
GPG Key ID: 3338A31AFDB1D829

View File

@ -27,7 +27,11 @@ version_string() {
homebrew-version() {
echo "Homebrew ${HOMEBREW_VERSION}"
echo "Homebrew/homebrew-core $(version_string "${HOMEBREW_CORE_REPOSITORY}")"
if [[ -n "${HOMEBREW_NO_INSTALL_FROM_API}" || -d "${HOMEBREW_CORE_REPOSITORY}" ]]
then
echo "Homebrew/homebrew-core $(version_string "${HOMEBREW_CORE_REPOSITORY}")"
fi
if [[ -d "${HOMEBREW_CASK_REPOSITORY}" ]]
then