From 52ee922459d1f8a5b0db794acf35420f98e53213 Mon Sep 17 00:00:00 2001 From: Daniel Barber Date: Wed, 17 Jul 2019 17:40:42 -0400 Subject: [PATCH] Use the location of `brew` to determine where `asdf` is --- zsh/configs/post/path.zsh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/zsh/configs/post/path.zsh b/zsh/configs/post/path.zsh index 575af42..598f6ad 100644 --- a/zsh/configs/post/path.zsh +++ b/zsh/configs/post/path.zsh @@ -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