From 566564eb9cd1162f3e270997e6381700253c4341 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Wed, 6 Apr 2016 20:53:14 -0400 Subject: Simplify install script --- install.sh | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'install.sh') diff --git a/install.sh b/install.sh index 4525c1ab..13d0d99b 100755 --- a/install.sh +++ b/install.sh @@ -2,23 +2,35 @@ # Create symlinks in ~ for files in the current directory. -set -e +set -o errexit -o nounset -o pipefail error() { echo "$1" exit 1 } -paths=$(find $PWD -type f -not \( -path '*/.git/*' -o -path '*/Library/*' -o -name '.*.sw?' -o -name 'README.md' -o -name '*.sh' -o -name '*.plist' \)) +link() { + local source_path="$PWD/$1" + local dest_path="$HOME/$1" -for source_path in $paths; do - rel_path="${source_path#$PWD/}" - dest_path="$HOME/$rel_path" - - [ -h "$dest_path" ] && continue + [ -h "$dest_path" ] && return [ -e "$dest_path" ] && error "$dest_path exists" mkdir -p "$(dirname $dest_path)" ln -s "$source_path" "$dest_path" - echo "$rel_path" -done + echo "$1" +} + +link .config/git/config +link .config/git/ignore +link .config/nvim/autoload/pathogen.vim +link .config/nvim/colors/gruvbox.vim +link .config/nvim/init.vim +link .gnupg/gpg-agent.conf +link .psqlrc +link .ssh/config +link .tmux.conf +link .vim/autoload/pathogen.vim +link .vim/colors/gruvbox.vim +link .vimrc +link .zshrc -- cgit 1.4.1