asdf.plugin.zsh 524 B

12345678910111213141516171819
  1. # Find where asdf should be installed
  2. ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}"
  3. ASDF_COMPLETIONS="$ASDF_DIR/completions"
  4. # If not found, check for Homebrew package
  5. if [[ ! -f "$ASDF_DIR/asdf.sh" ]] && (( $+commands[brew] )); then
  6. ASDF_DIR="$(brew --prefix asdf)"
  7. ASDF_COMPLETIONS="$ASDF_DIR/etc/bash_completion.d"
  8. fi
  9. # Load command
  10. if [[ -f "$ASDF_DIR/asdf.sh" ]]; then
  11. . "$ASDF_DIR/asdf.sh"
  12. # Load completions
  13. if [[ -f "$ASDF_COMPLETIONS/asdf.bash" ]]; then
  14. . "$ASDF_COMPLETIONS/asdf.bash"
  15. fi
  16. fi