d93f3174504f8a0c21aef6998714e3b67ba82606
- Author
- Carlo <carlosalag@protonmail.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
fix(init): prevent multiple compdump compilations (#11345)
Closes #11341
Diff
1diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
2index 29d39ca23523cb0ad2b5031413de16b33dab8edb..e94c2f4172b9549339200100a0ca8fed93b88895 100644
3--- a/oh-my-zsh.sh
4+++ b/oh-my-zsh.sh
5@@ -143,7 +143,10 @@ fi
6 unset zcompdump_revision zcompdump_fpath zcompdump_refresh
7
8 # zcompile the completion dump file if the .zwc is older or missing.
9-zrecompile -q -p "$ZSH_COMPDUMP" && command rm -f "$ZSH_COMPDUMP.zwc.old"
10+if command mkdir "${ZSH_COMPDUMP}.lock" 2>/dev/null; then
11+ zrecompile -q -p "$ZSH_COMPDUMP"
12+ command rm -rf "$ZSH_COMPDUMP.zwc.old" "${ZSH_COMPDUMP}.lock"
13+fi
14
15 # Load all of the config files in ~/oh-my-zsh that end in .zsh
16 # TIP: Add files you don't want in git to .gitignore