Use the location of brew to determine where asdf is

This commit is contained in:
Daniel Barber 2019-07-17 17:40:42 -04:00 committed by Daniel Barber
parent dbbae5752b
commit 52ee922459

View file

@ -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