asdf.plugin.zsh
543 bytes
1(( ! $+commands[asdf] )) && return
2
3export ASDF_DATA_DIR="${ASDF_DATA_DIR:-$HOME/.asdf}"
4
5# Add shims to the front of the path, removing if already present.
6path=("$ASDF_DATA_DIR/shims" ${path:#$ASDF_DATA_DIR/shims})
7
8# If the completion file doesn't exist yet, we need to autoload it and
9# bind it to `asdf`. Otherwise, compinit will have already done that.
10if [[ ! -f "$ZSH_CACHE_DIR/completions/_asdf" ]]; then
11 typeset -g -A _comps
12 autoload -Uz _asdf
13 _comps[asdf]=_asdf
14fi
15asdf completion zsh >| "$ZSH_CACHE_DIR/completions/_asdf" &|