From d1feed5b88fe49cdbb9a93c81c0d95d932af74c7 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 30 Jul 2014 01:14:25 -0400 Subject: [PATCH] An even smarter install.sh --- install.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 0205b332..df6b493b 100755 --- a/install.sh +++ b/install.sh @@ -4,8 +4,15 @@ [ ! -d ~/.dotfiles ] && git clone https://github.com/hlissner/dotfiles ~/.dotfiles setopt EXTENDED_GLOB -for rcfile in "${ZDOTDIR:-$HOME}"/.dotfiles/^(README.md|Gemfile|install.sh)(.N); do +for rcfile in "${ZDOTDIR:-$HOME}"/.dotfiles/^(bin|README.md|Gemfile|install.sh)(N); do filep="${ZDOTDIR:-$HOME}/.${rcfile:t}" - [ -h $filep ] || ln -s "$rcfile" $filep + if [ -e "$filep" ]; then + echo "~/.${rcfile:t} already existed. Skipping..." + continue + else + echo "Linking ${rcfile:t} to ~/.${rcfile:t}" + fi + + ln -s "$rcfile" $filep done