浏览代码

asdf: fix completions if ASDF_DIR is already exported (#8538)

Albert Serrallé Ríos 4 年之前
父节点
当前提交
7c9c148ec2
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      plugins/asdf/asdf.plugin.zsh

+ 1 - 1
plugins/asdf/asdf.plugin.zsh

@@ -3,7 +3,7 @@ ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}"
 ASDF_COMPLETIONS="$ASDF_DIR/completions"
 
 # If not found, check for Homebrew package
-if [[ ! -f "$ASDF_DIR/asdf.sh" ]] && (( $+commands[brew] )); then
+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"
 fi