diff --git a/install.sh b/install.sh index f7d26774..684a0ddd 100755 --- a/install.sh +++ b/install.sh @@ -1,19 +1,13 @@ -#!/bin/zsh +#!/bin/bash # In case this file was run via curl [ ! -d ~/.dotfiles ] && git clone https://github.com/hlissner/dotfiles ~/.dotfiles [ ! -d ~/.zprezto ] && git clone --recursive https://github.com/hlissner/prezto ~/.zprezto -setopt EXTENDED_GLOB -for rcfile in "${ZDOTDIR:-$HOME}"/.dotfiles/^(bin|README.md|Gemfile|install.sh)(N); do - filep="${ZDOTDIR:-$HOME}/.${rcfile:t}" +shopt -s extglob +for rcfile in "$HOME"/.dotfiles/!(bin|README.md|Gemfile|install.sh); do + filep="$HOME/."$(basename "$rcfile") - if [ -e "$filep" ]; then - echo "~/.${rcfile:t} already existed. Skipping..." - continue - else - echo "Linking ${rcfile:t} to ~/.${rcfile:t}" - fi - - ln -s "$rcfile" $filep + [ -e "$filep" ] && continue + ln -vs "$rcfile" $filep done