Skip to content

Commit

Permalink
brew.sh: test HOMEBREW_INSTALL_FROM_API on developers.
Browse files Browse the repository at this point in the history
Test `HOMEBREW_INSTALL_FROM_API` on `HOMEBREW_DEV_CMD_RUN` and
`HOMEBREW_DEVELOPER` folks who haven't run a
`HOMEBREW_DEVELOPER_COMMAND`.

The next step after this will be to make this functionality the default
for everyone.
  • Loading branch information
MikeMcQuaid committed Jan 18, 2023
1 parent 260ee0e commit ce34766
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Library/Homebrew/brew.sh
Expand Up @@ -766,6 +766,16 @@ To turn developer mode off, run $(bold "brew developer off")
export HOMEBREW_DEV_CMD_RUN="1"
fi

# Test HOMEBREW_INSTALL_FROM_API on HOMEBREW_DEV_CMD_RUN and HOMEBREW_DEVELOPER
# folks who haven't run a HOMEBREW_DEVELOPER_COMMAND.
if [[ -z "${HOMEBREW_NO_INSTALL_FROM_API}" &&
-z "${HOMEBREW_INSTALL_FROM_API}" &&
-z "${HOMEBREW_DEVELOPER_COMMAND}" ]] &&
[[ -n "${HOMEBREW_DEV_CMD_RUN}" || -n "${HOMEBREW_DEVELOPER}" ]]
then
export HOMEBREW_INSTALL_FROM_API=1
fi

if [[ -f "${HOMEBREW_LIBRARY}/Homebrew/cmd/${HOMEBREW_COMMAND}.sh" ]]
then
HOMEBREW_BASH_COMMAND="${HOMEBREW_LIBRARY}/Homebrew/cmd/${HOMEBREW_COMMAND}.sh"
Expand Down

0 comments on commit ce34766

Please sign in to comment.