nushell: [uninstall] Query nu for autoload directory

Mirror the install fix. Fall back to the XDG path when `nu` is no
longer on PATH (e.g. nushell already uninstalled).
This commit is contained in:
Junegunn Choi
2026-05-24 00:13:24 +09:00
parent 94f6daa61c
commit 1b6e17ca39
+5 -1
View File
@@ -114,7 +114,11 @@ if [ -d "${fish_dir}/functions" ]; then
fi
fi
nushell_autoload_dir=${XDG_CONFIG_HOME:-$HOME/.config}/nushell/autoload
if command -v nu > /dev/null; then
nushell_autoload_dir=$(nu -c '$nu.user-autoload-dirs | first')
else
nushell_autoload_dir=${XDG_CONFIG_HOME:-$HOME/.config}/nushell/autoload
fi
remove "${nushell_autoload_dir}/_fzf_integration.nu"
config_dir=$(dirname "$prefix_expand")