diff --git a/tools/install.sh b/tools/install.sh index cac51df..be24ee2 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -12,12 +12,25 @@ if [ ! -n "$ZSH" ]; then ZSH=$ZCNF/tools/oh-my-zsh fi +echo "\033[0;34mCleaning...\033[0m" +if [ -d ~/.config ]; then + if [ -d ~/.config/oh-my-zsh ]; then + rm -rf ~/.config/oh-my-zsh + fi + if [ -d ~/.config/antigen ]; then + rm -rf ~/.config/antigen + fi +fi +if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then + rm ~/.zshrc +fi +if [ -f ~/.bash_aliases ] || [ -h ~/.bash_aliases ]; then + rm ~/.bash_aliases +fi + echo "\033[0;34mCloning Zsh Config...\033[0m" hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || { - echo "can't clone repo.. trying to pull" - hash git >/dev/null 2>&1 && env git pull --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || { - echo "can't pull, either.. giving up.." - } + echo "can't clone repo.." } echo "\033[0;34mLooking for an existing zsh config...\033[0m" @@ -28,7 +41,6 @@ fi echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m" ln -s $ZCNF/templates/zshrc ~/.zshrc -rm ~/.bash_aliases ln -s $ZCNF/templates/bash_aliases ~/.bash_aliases sed -i -e "/^export ZSH=/ c\\ export ZSH=$ZSH