Files
dotfiles/.config/zsh/autoload/zwcautocompile
2026-02-12 22:19:51 +01:00

22 lines
591 B
Plaintext

## Automatically compile all compilable files to zwc
function zwcautocompile() {
autoload -Uz zrecompile
for f in $(find "${ZDOTDIR}" -maxdepth 3 -type f \( -name "*.zsh" -o -name ".zlogin" -o -name ".zshrc" \) ! -name "*.zwc" ! -name "*.zwc.old"); do
zrecompile -pq "${f}" && rm -f "${f}.zwc.old"
done
if [[ -d "${ZAUTOLOADDIR}" ]]; then
for f in "${ZAUTOLOADDIR}"/*; do
zrecompile -pq "${f}" && rm -f "${f}.zwc.old"
done
fi
if [[ -d "${ZLIBDIR}" ]]; then
for f in "${ZLIBDIR}"/*; do
zrecompile -pq "${f}" && rm -f "${f}.zwc.old"
done
fi
}