diff --git a/install.sh b/install.sh index 5a0e8c64..0205b332 100755 --- a/install.sh +++ b/install.sh @@ -1,20 +1,11 @@ -#!/bin/sh - -function do_link { - if [ ! -h "$HOME/.$1" ]; then - echo "ln -sf '$HOME/.dotfiles/$1' '$HOME/.$1'" - ln -sf "$HOME/.dotfiles/$1" "$HOME/.$1" - fi -} +#!/bin/zsh +# In case this file was run via curl [ ! -d ~/.dotfiles ] && git clone https://github.com/hlissner/dotfiles ~/.dotfiles -do_link zsh -do_link zshrc -do_link zshenv -do_link tmux.conf -do_link gitignore -do_link gitconfig -do_link bashrc -do_link ctags -do_link rake +setopt EXTENDED_GLOB +for rcfile in "${ZDOTDIR:-$HOME}"/.dotfiles/^(README.md|Gemfile|install.sh)(.N); do + filep="${ZDOTDIR:-$HOME}/.${rcfile:t}" + + [ -h $filep ] || ln -s "$rcfile" $filep +done