mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-19 00:37:35 +08:00
Compare commits
No commits in common. "c58572d5fe51b3ba09801837b6eee2cb6f0bf913" and "93cc3964e2d265ab0571298d69d2eed0a65d13f2" have entirely different histories.
c58572d5fe
...
93cc3964e2
17
oh-my-zsh.sh
17
oh-my-zsh.sh
@ -62,12 +62,13 @@ if [ -z "$ZSH_COMPDUMP" ]; then
|
||||
fi
|
||||
|
||||
# Construct zcompdump OMZ metadata
|
||||
zcompdump_revision="#omz revision: $(builtin cd -q "$ZSH"; git rev-parse HEAD 2>/dev/null)"
|
||||
zcompdump_fpath="#omz fpath: $fpath"
|
||||
zcompdump_metadata="\
|
||||
#omz revision: $(builtin cd -q "$ZSH"; git rev-parse HEAD 2>/dev/null)
|
||||
#omz fpath: $fpath\
|
||||
"
|
||||
|
||||
# Delete the zcompdump file if OMZ zcompdump metadata changed
|
||||
if ! command grep -q -Fx "$zcompdump_revision" "$ZSH_COMPDUMP" 2>/dev/null \
|
||||
|| ! command grep -q -Fx "$zcompdump_fpath" "$ZSH_COMPDUMP" 2>/dev/null; then
|
||||
if ! cmp -s <(command grep '^#omz' "$ZSH_COMPDUMP" 2>/dev/null) <(echo "$zcompdump_metadata"); then
|
||||
command rm -f "$ZSH_COMPDUMP"
|
||||
zcompdump_refresh=1
|
||||
fi
|
||||
@ -85,14 +86,10 @@ fi
|
||||
|
||||
# Append zcompdump metadata if missing
|
||||
if (( $zcompdump_refresh )); then
|
||||
cat >>| "$ZSH_COMPDUMP" <<EOF
|
||||
|
||||
$zcompdump_revision
|
||||
$zcompdump_fpath
|
||||
EOF
|
||||
echo "\n$zcompdump_metadata" | tee -a "$ZSH_COMPDUMP" &>/dev/null
|
||||
fi
|
||||
|
||||
unset zcompdump_revision zcompdump_fpath zcompdump_refresh
|
||||
unset zcompdump_metadata zcompdump_refresh
|
||||
|
||||
|
||||
# Load all of the config files in ~/oh-my-zsh that end in .zsh
|
||||
|
||||
Loading…
Reference in New Issue
Block a user