1
0

zsh: compile cache & cache flush

This commit is contained in:
Konstantin Demin 2022-09-05 10:35:13 +03:00
parent 5041d2c7e7
commit ac9d7a7de6
Signed by: krd
GPG Key ID: 1F33CB0BA4731BC6
2 changed files with 7 additions and 2 deletions

View File

@ -10,7 +10,7 @@ __z_compdump_print() { printf '#zshu %s %s\n' "$1" "${(P)1}" ; }
__z_compdump_invalidate() {
command rm -f "${ZSHU[f_compdump]}"
find "${ZSHU[d_compcache]}/" -xdev -mindepth 1 -type f '!' -name '.keep' -delete
find "${ZSHU[d_compcache]}/" -xdev -type f '!' -name '.keep' -delete
ZSHU[compdump_refresh]=1
}

View File

@ -13,6 +13,10 @@ dotfiles-git() { (
z-update() {
dotfiles-update
for i ( $(find "${ZSHU[d_conf]}/" -xdev -type f -name '*.zsh') ) ; do
zcompile "$i"
done ; unset i
}
z-reload() {
@ -22,5 +26,6 @@ z-reload() {
## reload or new session are required to regenerate compcache
z-cache-flush() {
find "${ZSHU[d_cache]}/" -xdev -mindepth 1 -type f '!' -name '.keep' -delete
find "${ZSHU[d_cache]}/" "${ZSHU[d_compcache]}/" -xdev -type f '!' -name '.keep' -delete
find "${ZSHU[d_conf]}/" -xdev -type f -name '*.zwc' -delete
}