Skip to content

Commit f1df209

Browse files
authored
Merge pull request Homebrew#732 from MikeMcQuaid/install_from_api_default
Use HOMEBREW_INSTALL_FROM_API by default
2 parents fc4a19b + ef9cc46 commit f1df209

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ More installation information and options: <https://docs.brew.sh/Installation>.
1010

1111
If running Linux or WSL, [there are some pre-requisite packages to install](https://docs.brew.sh/Homebrew-on-Linux#requirements).
1212

13+
You can set `HOMEBREW_NO_INSTALL_FROM_API` to tap Homebrew/homebrew-core; by default, it will not be tapped as it is no longer necessary.
14+
1315
You can set `HOMEBREW_BREW_GIT_REMOTE` and/or `HOMEBREW_CORE_GIT_REMOTE` in your shell environment to use geolocalized Git mirrors to speed up Homebrew's installation with this script and, after installation, `brew update`.
1416

1517
```bash

install.sh

+6-13
Original file line numberDiff line numberDiff line change
@@ -754,10 +754,10 @@ then
754754
additional_shellenv_commands+=("export HOMEBREW_CORE_GIT_REMOTE=\"${HOMEBREW_CORE_GIT_REMOTE}\"")
755755
fi
756756

757-
if [[ -z "${HOMEBREW_NO_INSTALL_FROM_API-}" && -n "${HOMEBREW_INSTALL_FROM_API-}" ]]
757+
if [[ -n "${HOMEBREW_NO_INSTALL_FROM_API-}" ]]
758758
then
759-
ohai "HOMEBREW_INSTALL_FROM_API is set."
760-
echo "Homebrew/homebrew-core will not be tapped during this ${tty_bold}install${tty_reset} run."
759+
ohai "HOMEBREW_NO_INSTALL_FROM_API is set."
760+
echo "Homebrew/homebrew-core will be tapped during this ${tty_bold}install${tty_reset} run."
761761
fi
762762

763763
if [[ -z "${NONINTERACTIVE-}" ]]
@@ -914,18 +914,11 @@ ohai "Downloading and installing Homebrew..."
914914
fi
915915
fi
916916

917-
if [[ -z "${HOMEBREW_NO_INSTALL_FROM_API-}" && -n "${HOMEBREW_INSTALL_FROM_API-}" ]]
917+
if [[ -n "${HOMEBREW_NO_INSTALL_FROM_API-}" && ! -d "${HOMEBREW_CORE}" ]]
918918
then
919+
# Always use single-quoted strings with `exp` expressions
919920
# shellcheck disable=SC2016
920-
ohai 'Skip tapping homebrew/core because `$HOMEBREW_INSTALL_FROM_API` is set.'
921-
# Unset HOMEBREW_DEVELOPER since it is no longer needed and causes warnings during brew update below
922-
if [[ -n "${HOMEBREW_ON_LINUX-}" && (-n "${HOMEBREW_CURL_PATH-}" || -n "${HOMEBREW_GIT_PATH-}") ]]
923-
then
924-
export -n HOMEBREW_DEVELOPER
925-
fi
926-
elif [[ ! -d "${HOMEBREW_CORE}" ]]
927-
then
928-
ohai "Tapping homebrew/core"
921+
ohai 'Tapping homebrew/core because `$HOMEBREW_NO_INSTALL_FROM_API` is set.'
929922
(
930923
execute "${MKDIR[@]}" "${HOMEBREW_CORE}"
931924
cd "${HOMEBREW_CORE}" >/dev/null || return

0 commit comments

Comments
 (0)