diff options
| author | Doug Hazell | 2017-02-19 02:12:46 +0000 |
|---|---|---|
| committer | Doug Hazell | 2017-02-19 02:12:46 +0000 |
| commit | 5d1576784a5603662ca9910eb97c948e833f35c9 (patch) | |
| tree | 76554a8122b5863a138d8feb4e6a0da82f318efc /bin | |
| parent | adc43466a6c3d807344e0350e8d1776c4bd78a31 (diff) | |
| download | brew-5d1576784a5603662ca9910eb97c948e833f35c9.tar.bz2 | |
Mechanism to dynamically add HOMEBREW.* vars to 'env -i' command string in 'bin/brew'
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/brew | 23 |
1 files changed, 15 insertions, 8 deletions
@@ -46,15 +46,22 @@ HOMEBREW_LIBRARY="$HOMEBREW_REPOSITORY/Library" if [[ -n "$HOMEBREW_ENV_FILTERING" ]] then - env -i \ - HOME="$HOME" \ + + homebrew_vars=$("$HOMEBREW_LIBRARY/Homebrew/utils/homebrew_vars.rb") + + cmd_str="/usr/bin/env -i \ + HOME=$HOME \ PATH=/usr/bin:/bin:/usr/sbin:/sbin \ - TERM="$TERM" \ - HOMEBREW_BREW_FILE="$HOMEBREW_BREW_FILE" \ - HOMEBREW_PREFIX="$HOMEBREW_PREFIX" \ - HOMEBREW_REPOSITORY="$HOMEBREW_REPOSITORY" \ - HOMEBREW_LIBRARY="$HOMEBREW_LIBRARY" \ - /bin/bash "$HOMEBREW_LIBRARY/Homebrew/brew.sh" "$@" + TERM=$TERM \ + HOMEBREW_BREW_FILE=$HOMEBREW_BREW_FILE \ + HOMEBREW_PREFIX=$HOMEBREW_PREFIX \ + HOMEBREW_REPOSITORY=$HOMEBREW_REPOSITORY \ + HOMEBREW_LIBRARY=$HOMEBREW_LIBRARY \ + $homebrew_vars \ + /bin/bash $HOMEBREW_LIBRARY/Homebrew/brew.sh $@" + + command $cmd_str + else source "$HOMEBREW_LIBRARY/Homebrew/brew.sh" fi |
