From 35f3b784ad46de2fd6fde38539c77d167684b0d9 Mon Sep 17 00:00:00 2001 From: Ben Kreeger Date: Mon, 17 Apr 2023 21:20:15 -0500 Subject: [PATCH] Update setup script --- setup.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) mode change 100644 => 100755 setup.sh 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