From 4bc1d27ef5f37db5dfaf3f3b4de8d284273c84dd Mon Sep 17 00:00:00 2001 From: Muhammed Oguz Date: Fri, 11 Apr 2025 12:09:47 +0300 Subject: [PATCH] fix(asdf): allow plugin to initialize if asdf is installed in ~/.asdf Previously, the plugin exited early if the `asdf` command was not already in $PATH: (( ! $+commands[asdf] )) && return This broke valid setups where `asdf` is installed manually in ~/.asdf and not yet sourced globally (e.g., via .zshrc). Such installs are still recommended in the official asdf documentation. This change replaces the early exit with a check for the presence of ~/.asdf, so the plugin only runs if the user has a modern asdf setup, while avoiding premature return before `$PATH` and completions are set up. This preserves the new plugin behavior (removal of legacy <0.16 logic), while restoring compatibility for the common manual install path. --- plugins/asdf/asdf.plugin.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh index 318267dcb..f1e9e09f7 100644 --- a/plugins/asdf/asdf.plugin.zsh +++ b/plugins/asdf/asdf.plugin.zsh @@ -1,4 +1,7 @@ -(( ! $+commands[asdf] )) && return +# Only continue if .asdf directory exists (manual install) or fallback logic can apply +if [[ ! -d "$HOME/.asdf" ]]; then + return +fi export ASDF_DATA_DIR="${ASDF_DATA_DIR:-$HOME/.asdf}" path=("$ASDF_DATA_DIR/shims" $path)