Guard Docker init scripts with existence checks

Prevents errors when Docker Desktop is not installed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Eric Wagoner
2026-03-03 09:26:37 -05:00
parent ae364ba61b
commit 42fa784644
3 changed files with 7 additions and 6 deletions

9
zshrc
View File

@@ -130,7 +130,7 @@ export NVM_QUIET=1
typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet
# Docker
source $HOME/.docker/init-zsh.sh || true
[[ -f "$HOME/.docker/init-zsh.sh" ]] && source "$HOME/.docker/init-zsh.sh"
# iTerm2 integration
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
@@ -157,8 +157,9 @@ alias nowdate='date +"%d-%m-%Y"'
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# The following lines have been added by Docker Desktop to enable Docker CLI completions.
fpath=($HOME/.docker/completions $fpath)
# Docker CLI completions
if [[ -d "$HOME/.docker/completions" ]]; then
fpath=($HOME/.docker/completions $fpath)
fi
autoload -Uz compinit
compinit
# End of Docker CLI completions