From b9575ac8de66afd3a74665751760fa2edbda6061 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 7 Oct 2013 08:16:53 +0100 Subject: Move dotfiles under ~/projects --- install | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'install') diff --git a/install b/install index 6eb4591..41d8290 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 -- cgit 1.4.1