diff options
| author | Mike McQuaid | 2013-02-08 08:55:42 -0800 |
|---|---|---|
| committer | Mike McQuaid | 2013-02-21 21:42:18 +0000 |
| commit | f9f05d1173805c533f5d31a398633f87475de833 (patch) | |
| tree | d1231dae86c25306c068dd404033e169bfaf66dc /bin | |
| parent | 191e9ed88a92a16fea93223e5034e7d493cda5d3 (diff) | |
| download | brew-f9f05d1173805c533f5d31a398633f87475de833.tar.bz2 | |
brew: use a shell wrapper script for brew
This reverts commit dfd4dd12a41e1697ee9d5feac12cc1ea7c3a590e.
Fixes the problems from Homebrew/homebrew#17683 and Homebrew/homebrew#17685.
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/brew | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bin/brew b/bin/brew new file mode 100755 index 000000000..027640677 --- /dev/null +++ b/bin/brew @@ -0,0 +1,24 @@ +#!/bin/sh +BREW_FILE_DIRECTORY=$(dirname "$0") +BREW_FILE_DIRECTORY=$(cd "$BREW_FILE_DIRECTORY" && pwd -P) + +BREW_FILENAME=$(basename "$0") +export HOMEBREW_BREW_FILE="$BREW_FILE_DIRECTORY/$BREW_FILENAME" + +BREW_SYMLINK=$(readlink $0) +if [ -n "$BREW_SYMLINK" ] +then + BREW_SYMLINK_DIRECTORY=$(dirname "$BREW_SYMLINK") + BREW_FILE_DIRECTORY=$(cd "$BREW_FILE_DIRECTORY" && + cd "$BREW_SYMLINK_DIRECTORY" && pwd -P) +fi + +BREW_LIBRARY_DIRECTORY=$(cd "$BREW_FILE_DIRECTORY"/../Library && pwd -P) + +BREW_SYSTEM=$(uname -s | tr "[:upper:]" "[:lower:]") +if [ "$BREW_SYSTEM" = "darwin" ] +then + exec "$BREW_LIBRARY_DIRECTORY/brew.rb" "$@" +else + exec ruby -W0 "$BREW_LIBRARY_DIRECTORY/brew.rb" "$@" +fi |
