mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-09-29 06:26:06 +02:00
perf(init): skip the compdump lock and zrecompile when the .zwc is fresh (#14064)
This commit is contained in:
+3
-1
@@ -148,7 +148,9 @@ fi
|
|||||||
unset zcompdump_revision zcompdump_fpath zcompdump_refresh
|
unset zcompdump_revision zcompdump_fpath zcompdump_refresh
|
||||||
|
|
||||||
# zcompile the completion dump file if the .zwc is older or missing.
|
# zcompile the completion dump file if the .zwc is older or missing.
|
||||||
if command mkdir "${ZSH_COMPDUMP}.lock" 2>/dev/null; then
|
# Test that first so the lock directory and zrecompile are skipped when it's fresh.
|
||||||
|
if [[ ! "${ZSH_COMPDUMP}.zwc" -nt "$ZSH_COMPDUMP" ]] \
|
||||||
|
&& command mkdir "${ZSH_COMPDUMP}.lock" 2>/dev/null; then
|
||||||
zrecompile -q -p "$ZSH_COMPDUMP"
|
zrecompile -q -p "$ZSH_COMPDUMP"
|
||||||
command rm -rf "$ZSH_COMPDUMP.zwc.old" "${ZSH_COMPDUMP}.lock"
|
command rm -rf "$ZSH_COMPDUMP.zwc.old" "${ZSH_COMPDUMP}.lock"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user