diff --git a/setup.sh b/setup.sh old mode 100644 new mode 100755 index b660ee2..2c9ec44 --- a/setup.sh +++ b/setup.sh @@ -1,5 +1,20 @@ #/usr/bin/env bash # Setup script. -git clone --recurse-submodules https://github.com/kreeger/zshrc.git $HOME/.zsh -ln -sfv $HOME/.zsh/zshrc $HOME/.zshrc +if [[ ! -d "$HOME/.zsh" ]]; then + git clone --recurse-submodules https://github.com/kreeger/zshrc.git $HOME/.zsh +fi + +if [[ ! -a "$HOME/.zshrc" ]]; then + ln -sfv $HOME/.zsh/zshrc $HOME/.zshrc +fi + +# Link dotfiles. +declare -a dotfiles=("gemrc" "gitconfig" "gitignore.global") + +for file in "${dotfiles[@]}" +do + if [[ ! -a "$HOME/.$file" ]]; then + ln -sfv $HOME/.dotfiles/.$file $HOME/.$file + fi +done