diff options
| author | Martin Afanasjew | 2015-11-20 20:52:29 +0100 |
|---|---|---|
| committer | Martin Afanasjew | 2015-12-01 21:36:05 +0100 |
| commit | 8f175cb03c57ac3a426d7cc1420f2b65aeaafd22 (patch) | |
| tree | 3f66e7e082c8fd5d212bbcd1624e6c6ae8a59fd9 | |
| parent | 73a7889de57135858d1484f9c7e4e2ce726e3f4a (diff) | |
| download | brew-8f175cb03c57ac3a426d7cc1420f2b65aeaafd22.tar.bz2 | |
bin/brew: separate variable assignment and export
This very slightly reduces duplication and the risk of inconsistency by
exporting in one branch, but not the other. By putting all the `export`
statements right before the `exec` it is more obvious what is passed on.
| -rwxr-xr-x | bin/brew | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -4,7 +4,7 @@ chdir() { } BREW_FILE_DIRECTORY="$(chdir "${0%/*}" && pwd -P)" -export HOMEBREW_BREW_FILE="$BREW_FILE_DIRECTORY/${0##*/}" +HOMEBREW_BREW_FILE="$BREW_FILE_DIRECTORY/${0##*/}" BREW_SYMLINK="$(readlink "$0")" if [ -n "$BREW_SYMLINK" ] @@ -31,10 +31,13 @@ then BREW_SYSTEM="$(uname -s | tr "[:upper:]" "[:lower:]")" if [ "$BREW_SYSTEM" = "darwin" ] then - export HOMEBREW_RUBY_PATH="/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby" + HOMEBREW_RUBY_PATH="/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby" else - export HOMEBREW_RUBY_PATH="$(which ruby)" + HOMEBREW_RUBY_PATH="$(which ruby)" fi fi +export HOMEBREW_BREW_FILE +export HOMEBREW_RUBY_PATH + exec "$HOMEBREW_RUBY_PATH" -W0 "$BREW_LIBRARY_DIRECTORY/brew.rb" "$@" |
