bug(asdf): don't add shims to the path if already present

This commit is contained in:
Patrick W. Healy 2025-08-15 20:39:06 +00:00
commit 558ff1399d

View file

@ -1,7 +1,9 @@
(( ! $+commands[asdf] )) && return
export ASDF_DATA_DIR="${ASDF_DATA_DIR:-$HOME/.asdf}"
path=("$ASDF_DATA_DIR/shims" $path)
# Only add to the path if not already present
(($path[(Ie)$ASDF_DATA_DIR/shims])) || path=("$ASDF_DATA_DIR/shims" $path)
# If the completion file doesn't exist yet, we need to autoload it and
# bind it to `asdf`. Otherwise, compinit will have already done that.