summaryrefslogtreecommitdiff
path: root/plugins/asdf
diff options
context:
space:
mode:
authorPatrick W. Healy <phealy@phealy.com>2025-08-16 14:17:14 -0500
committerGitHub <noreply@github.com>2025-08-16 21:17:14 +0200
commit5d37f723f6c92d9fe043ea9f0aa460cd0bd0258a (patch)
tree404ed0338e6a0ba9b1c99c4ae5953703fa478a46 /plugins/asdf
parent51760e1d4aa417846b41a32ad845aaacc053a7f5 (diff)
downloadzsh-5d37f723f6c92d9fe043ea9f0aa460cd0bd0258a.tar.gz
zsh-5d37f723f6c92d9fe043ea9f0aa460cd0bd0258a.tar.bz2
zsh-5d37f723f6c92d9fe043ea9f0aa460cd0bd0258a.zip
fix(asdf): avoid prepending path entry multiple times (#13268)
Diffstat (limited to 'plugins/asdf')
-rw-r--r--plugins/asdf/asdf.plugin.zsh4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh
index 318267dcb..913949888 100644
--- a/plugins/asdf/asdf.plugin.zsh
+++ b/plugins/asdf/asdf.plugin.zsh
@@ -1,7 +1,9 @@
(( ! $+commands[asdf] )) && return
export ASDF_DATA_DIR="${ASDF_DATA_DIR:-$HOME/.asdf}"
-path=("$ASDF_DATA_DIR/shims" $path)
+
+# Add shims to the front of the path, removing if already present.
+path=("$ASDF_DATA_DIR/shims" ${path:#$ASDF_DATA_DIR/shims})
# 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.