diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh index c386d57ed..da53eef8e 100644 --- a/plugins/asdf/asdf.plugin.zsh +++ b/plugins/asdf/asdf.plugin.zsh @@ -4,16 +4,18 @@ ASDF_COMPLETIONS="$ASDF_DIR/completions" # If not found, check for Homebrew package if [[ ! -f "$ASDF_DIR/asdf.sh" || ! -f "$ASDF_COMPLETIONS/asdf.bash" ]] && (( $+commands[brew] )); then - ASDF_DIR="$(brew --prefix asdf)" - ASDF_COMPLETIONS="$ASDF_DIR/etc/bash_completion.d" + brew_prefix="$(brew --prefix asdf)" + ASDF_DIR="${brew_prefix}/libexec" + ASDF_COMPLETIONS="${brew_prefix}/etc/bash_completion.d" + unset brew_prefix fi # Load command if [[ -f "$ASDF_DIR/asdf.sh" ]]; then - . "$ASDF_DIR/asdf.sh" + . "$ASDF_DIR/asdf.sh" - # Load completions - if [[ -f "$ASDF_COMPLETIONS/asdf.bash" ]]; then - . "$ASDF_COMPLETIONS/asdf.bash" - fi + # Load completions + if [[ -f "$ASDF_COMPLETIONS/asdf.bash" ]]; then + . "$ASDF_COMPLETIONS/asdf.bash" + fi fi