Commit 05713785 authored by John Burwell's avatar John Burwell Committed by Marc Cornellà
Browse files

asdf: add Homebrew and completion support (#6749)

* Modifies the search logic for asdf to include Homebrew when it is
installed. The implementation is adapted from the pyenv plugin.
parent 91b77191
# Find where asdf should be installed. # Find where asdf should be installed
ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}" ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}"
# Load asdf, if found. # If not found, check for Homebrew package
if [ -f $ASDF_DIR/asdf.sh ]; then if [[ ! -d $ASDF_DIR ]] && (( $+commands[brew] )); then
. $ASDF_DIR/asdf.sh ASDF_DIR="$(brew --prefix asdf)"
fi fi
# Load asdf completions, if found. # Load command
if [ -f $ASDF_DIR/completions/asdf.bash ]; then if [[ -f "$ASDF_DIR/asdf.sh" ]]; then
. $ASDF_DIR/completions/asdf.bash . "$ASDF_DIR/asdf.sh"
# Load completions
if [[ -f "$ASDF_DIR/completions/asdf.bash" ]]; then
. "$ASDF_DIR/completions/asdf.bash"
fi
fi fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment