summary refs log tree commit diff stats
path: root/install
diff options
context:
space:
mode:
authorAlan Pearce2013-10-07 08:16:53 +0100
committerAlan Pearce2013-10-07 08:16:53 +0100
commitb9575ac8de66afd3a74665751760fa2edbda6061 (patch)
tree13ea584b0152ddb68fa7b193dc59afdab7cfe42e /install
parentd78b4c91e6985006094ad090f69bbc7b7eaa5da8 (diff)
downloaddotfiles-b9575ac8de66afd3a74665751760fa2edbda6061.tar.lz
dotfiles-b9575ac8de66afd3a74665751760fa2edbda6061.tar.zst
dotfiles-b9575ac8de66afd3a74665751760fa2edbda6061.zip
Move dotfiles under ~/projects
Diffstat (limited to 'install')
-rwxr-xr-xinstall31
1 files changed, 16 insertions, 15 deletions
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