mirror of
https://github.com/gosticks/brew.git
synced 2026-09-01 22:40:30 +00:00
We're using /bin/bash and not /bin/sh for a reason so don't allow users to override this (seen in Homebrew/homebrew#49514). Closes Homebrew/homebrew#49515.
26 lines
656 B
Bash
Executable File
26 lines
656 B
Bash
Executable File
#!/bin/bash
|
|
set +o posix
|
|
|
|
chdir() {
|
|
cd "$@" >/dev/null
|
|
}
|
|
|
|
BREW_FILE_DIRECTORY="$(chdir "${0%/*}" && pwd -P)"
|
|
HOMEBREW_BREW_FILE="$BREW_FILE_DIRECTORY/${0##*/}"
|
|
|
|
HOMEBREW_PREFIX="${HOMEBREW_BREW_FILE%/*/*}"
|
|
HOMEBREW_REPOSITORY="$HOMEBREW_PREFIX"
|
|
|
|
if [[ -L "$HOMEBREW_BREW_FILE" ]]
|
|
then
|
|
BREW_SYMLINK="$(readlink "$HOMEBREW_BREW_FILE")"
|
|
BREW_SYMLINK_DIRECTORY="$(dirname "$BREW_SYMLINK")"
|
|
BREW_FILE_DIRECTORY="$(chdir "$BREW_FILE_DIRECTORY" &&
|
|
chdir "$BREW_SYMLINK_DIRECTORY" && pwd -P)"
|
|
HOMEBREW_REPOSITORY="${BREW_FILE_DIRECTORY%/*}"
|
|
fi
|
|
|
|
HOMEBREW_LIBRARY="$HOMEBREW_REPOSITORY/Library"
|
|
|
|
source "$HOMEBREW_LIBRARY/brew.sh"
|