forked from Homebrew/legacy-homebrew
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
brew: use a shell wrapper script for brew
This reverts commit dfd4dd1. Fixes the problems from Homebrew#17683 and Homebrew#17685.
- Loading branch information
1 parent
8b9d620
commit ba2b235
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |