Use the location of brew
to determine where asdf
is
This commit is contained in:
parent
dbbae5752b
commit
52ee922459
1 changed files with 3 additions and 7 deletions
|
@ -4,14 +4,10 @@ PATH="$HOME/.bin:/usr/local/sbin:$PATH"
|
|||
# Try loading ASDF from the regular home dir location
|
||||
if [ -f "$HOME/.asdf/asdf.sh" ]; then
|
||||
. "$HOME/.asdf/asdf.sh"
|
||||
# It's not in the home dir, let's try the default Homebrew location
|
||||
elif [ -f "/usr/local/opt/asdf/asdf.sh" ]; then
|
||||
. "/usr/local/opt/asdf/asdf.sh"
|
||||
# Not there either! Last try, let's see if Homebrew can tell us where it is
|
||||
elif which brew >/dev/null &&
|
||||
ASDF_PREFIX=$(brew --prefix asdf) &&
|
||||
[ -f "$ASDF_PREFIX/asdf.sh" ]; then
|
||||
. "$ASDF_PREFIX/asdf.sh"
|
||||
BREW_DIR=$(which brew | sed 's/\/bin\/brew//') &&
|
||||
[ -f "$BREW_DIR/opt/asdf/asdf.sh" ]; then
|
||||
. "$BREW_DIR/opt/asdf/asdf.sh"
|
||||
fi
|
||||
|
||||
# mkdir .git/safe in the root of repositories you trust
|
||||
|
|
Loading…
Add table
Reference in a new issue