1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-10-23 04:53:45 +08:00

fix(docker): create completions cache dir if missing (#14188)

Closes #13679

Co-Authored-By: Markus Towara <mtowara@gmail.com>
This commit is contained in:
冰水泡枸杞
2026-10-20 08:17:06 +08:00
committed by GitHub
parent b056a436fe
commit a208c3a27a

View File

@@ -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