summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2013-05-18 21:16:52 +0100
committerAlan Pearce2013-05-18 21:16:52 +0100
commit40d623657794a009617ca0b28634649914870d02 (patch)
tree4bb54c1a8165f30ef0c606ee6e97fa049910b761
parent5649afdf7e4ab16bbbe8f9fb9c487125efa76b5f (diff)
downloadnixfiles-40d623657794a009617ca0b28634649914870d02.tar.lz
nixfiles-40d623657794a009617ca0b28634649914870d02.tar.zst
nixfiles-40d623657794a009617ca0b28634649914870d02.zip
Migrate post-checkout hook code to install and run install from post-checkout hook
-rwxr-xr-xgit-hooks/post-checkout32
-rwxr-xr-xinstall32
2 files changed, 33 insertions, 31 deletions
diff --git a/git-hooks/post-checkout b/git-hooks/post-checkout
index 910716f7..96f22007 100755
--- a/git-hooks/post-checkout
+++ b/git-hooks/post-checkout
@@ -1,32 +1,2 @@
 #!/usr/bin/env zsh
-if [[ -x =emacs ]]
-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
+exec "$GIT_DIR/../install"
diff --git a/install b/install
index 0596b3e4..96ea4410 100755
--- a/install
+++ b/install
@@ -43,3 +43,35 @@ then
 fi
 
 popd
+
+if [[ -x =emacs ]]
+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