my xfce4 dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
850 B

3 years ago
  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 archlinux/AUR package (/opt/asdf-vm/)
  5. if [[ ! -f "$ASDF_DIR/asdf.sh" || ! -f "$ASDF_COMPLETIONS/asdf.bash" ]] && [[ -f "/opt/asdf-vm/asdf.sh" ]]; then
  6. ASDF_DIR="/opt/asdf-vm"
  7. ASDF_COMPLETIONS="$ASDF_DIR"
  8. fi
  9. # If not found, check for Homebrew package
  10. if [[ ! -f "$ASDF_DIR/asdf.sh" || ! -f "$ASDF_COMPLETIONS/asdf.bash" ]] && (( $+commands[brew] )); then
  11. brew_prefix="$(brew --prefix asdf)"
  12. ASDF_DIR="${brew_prefix}/libexec"
  13. ASDF_COMPLETIONS="${brew_prefix}/etc/bash_completion.d"
  14. unset brew_prefix
  15. fi
  16. # Load command
  17. if [[ -f "$ASDF_DIR/asdf.sh" ]]; then
  18. . "$ASDF_DIR/asdf.sh"
  19. # Load completions
  20. if [[ -f "$ASDF_COMPLETIONS/asdf.bash" ]]; then
  21. . "$ASDF_COMPLETIONS/asdf.bash"
  22. fi
  23. fi