From a208c3a27aca696a7bb37e38bdb25e74dd317eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B0=E6=B0=B4=E6=B3=A1=E6=9E=B8=E6=9D=9E?= <87858694+xingzihai@users.noreply.github.com> Date: Tue, 20 Oct 2026 08:17:06 +0800 Subject: [PATCH] fix(docker): create completions cache dir if missing (#14188) Closes #13679 Co-Authored-By: Markus Towara --- plugins/docker/docker.plugin.zsh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/docker/docker.plugin.zsh b/plugins/docker/docker.plugin.zsh index c738f315c..88687438e 100644 --- a/plugins/docker/docker.plugin.zsh +++ b/plugins/docker/docker.plugin.zsh @@ -48,6 +48,11 @@ fi 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" 0="${${(M)0:#/*}:-$PWD/$0}" +# Make sure the cache directory exists; when the plugin is loaded by a +# standalone plugin manager (e.g. antigen) the core is not sourced, so +# $ZSH_CACHE_DIR/completions may not have been created yet (#13679). +[[ -d "$ZSH_CACHE_DIR/completions" ]] || mkdir -p "$ZSH_CACHE_DIR/completions" + # If the completion file doesn't exist yet, we need to autoload it and # bind it to `docker`. Otherwise, compinit will have already done that. if [[ ! -f "$ZSH_CACHE_DIR/completions/_docker" ]]; then