From 5649afdf7e4ab16bbbe8f9fb9c487125efa76b5f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 18 May 2013 21:00:12 +0100 Subject: Migrate zsh file compilation to post-checkout hook --- git-hooks/post-checkout | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'git-hooks') diff --git a/git-hooks/post-checkout b/git-hooks/post-checkout index dfceaee..910716f 100755 --- a/git-hooks/post-checkout +++ b/git-hooks/post-checkout @@ -4,3 +4,29 @@ then emacs --batch -f batch-byte-compile ~/.emacs.d/init.el emacs --batch -f batch-byte-compile ~/.emacs.d/elisp/*.el fi + +fasd_cache=~/.zsh/cache/fasd-init-zsh +if [[ ! -s "$fasd_cache" || zsh/functions/fasd -nt "$fasd_cache" ]]; then + zsh/functions/fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install >! "$fasd_cache" +fi + +autoload -U zrecompile +local -a zfiles +zfiles=( + zsh/functions/fasd/fasd + $fasd_cache + zsh/zshrc + zsh/zshrc_${HOST%%.*} +) +if [[ -e /usr/bin/emerge ]]; then + zfiles+=zsh/zshrc_gentoo +fi +if [[ $OSTYPE == freebsd ]]; then + zfiles+=zsh/zshrc_freebsd +fi + +zrecompile -p -R ~/.zshrc.zwc $zfiles + +for fp in zsh/functions/*(/); do + zrecompile -p $fp $fp/* +done -- cgit 1.4.1