conf2/zsh/.oh-my-zsh/plugins/asdf/asdf.plugin.zsh

20 lines
524 B
Bash
Raw Normal View History

2019-01-12 15:47:23 +00:00
# Find where asdf should be installed
ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}"
2019-10-24 19:09:05 +00:00
ASDF_COMPLETIONS="$ASDF_DIR/completions"
2019-01-12 15:47:23 +00:00
# If not found, check for Homebrew package
2019-10-24 19:09:05 +00:00
if [[ ! -f "$ASDF_DIR/asdf.sh" ]] && (( $+commands[brew] )); then
2019-01-12 15:47:23 +00:00
ASDF_DIR="$(brew --prefix asdf)"
2019-10-24 19:09:05 +00:00
ASDF_COMPLETIONS="$ASDF_DIR/etc/bash_completion.d"
2019-01-12 15:47:23 +00:00
fi
# Load command
if [[ -f "$ASDF_DIR/asdf.sh" ]]; then
. "$ASDF_DIR/asdf.sh"
# Load completions
2019-10-24 19:09:05 +00:00
if [[ -f "$ASDF_COMPLETIONS/asdf.bash" ]]; then
. "$ASDF_COMPLETIONS/asdf.bash"
2019-01-12 15:47:23 +00:00
fi
fi