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