Last active
January 4, 2016 17:09
-
-
Save MKorostoff/8652464 to your computer and use it in GitHub Desktop.
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
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment