#!/bin/zsh
#
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"

if [[ (-e ~/.bashrc.d) ]]; then
    echo "A bash configuration already exists (~/.bashrc.d)"
    echo "Remove this configuration and start the script again"
else
    echo "Creating base link"
    ln -vs $SCRIPTPATH/.bashrc.d ~/.bashrc.d
fi

GS=`grep .bashrc.d ~/.bashrc`
if [ ${#GS} -eq 0 ]; then
    echo "Adding execution of scripts in ~.bashrc.d"
    cat ~/.bashrc.d/BASHRC_ADDON >> ~/.bashrc
fi