diff options
Diffstat (limited to 'install')
-rwxr-xr-x | install | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/install b/install index 6eb45912..41d82902 100755 --- a/install +++ b/install @@ -1,10 +1,11 @@ #!/usr/bin/env zsh +target=~/projects/dotfiles pushd $HOME setopt EXTENDED_GLOB -if [[ ! -d dotfiles && ${(L)host} =~ prefect ]] +if [[ ! -d $target && ${(L)host} =~ prefect ]] then git clone ssh://alan@home.alanpearce.co.uk:22222/~/dotfiles.git fi @@ -33,13 +34,13 @@ install-dot () { done } -install-dot dotfiles/.git/hooks/ dotfiles/git-hooks/* -install-dot .emacs.d/ dotfiles/emacs/* -install-dot . dotfiles/^install(.) dotfiles/zsh/zshrc dotfiles/zsh/fasdrc -install-dot .ssh/ dotfiles/ssh/* +install-dot $target/.git/hooks/ $target/git-hooks/* +install-dot .emacs.d/ $target/emacs/* +install-dot . $target/^install(.) $target/zsh/zshrc $target/zsh/fasdrc +install-dot .ssh/ $target/ssh/* if [[ -d projects/dwm ]] then - install-dot projects/dwm/ dotfiles/dwm/* + install-dot projects/dwm/ $target/dwm/* fi if [[ -x =emacs ]] @@ -53,30 +54,30 @@ then fi fasd_cache=~/.zsh/cache/fasd-init-zsh -if [[ ! -s "$fasd_cache" || dotfiles/zsh/functions/fasd -nt "$fasd_cache" ]]; then - dotfiles/zsh/functions/fasd/fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install >! "$fasd_cache" +if [[ ! -s "$fasd_cache" || $target/zsh/functions/fasd -nt "$fasd_cache" ]]; then + $target/zsh/functions/fasd/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=( - dotfiles/zsh/functions/fasd/fasd + $target/zsh/functions/fasd/fasd $fasd_cache - dotfiles/zsh/zshrc + $target/zsh/zshrc ) -if [[ -f dotfiles/zsh/zshrc_${HOST%%.*} ]]; then - zfiles+=dotfiles/zsh/zshrc_${HOST%%.*} +if [[ -f $target/zsh/zshrc_${HOST%%.*} ]]; then + zfiles+=$target/zsh/zshrc_${HOST%%.*} fi if [[ -e /usr/bin/emerge ]]; then - zfiles+=dotfiles/zsh/zshrc_gentoo + zfiles+=$target/zsh/zshrc_gentoo fi if [[ $OSTYPE == freebsd* ]]; then - zfiles+=dotfiles/zsh/zshrc_freebsd + zfiles+=$target/zsh/zshrc_freebsd fi zrecompile -p -R ~/.zshrc.zwc $zfiles -for fp in dotfiles/zsh/functions/*(/); do +for fp in $target/zsh/functions/*(/); do zrecompile -p $fp $fp/* done |