#!/usr/bin/bash

set -e

rc_dir=.theme-d-intr-calc2
config_path=$rc_dir/config.scm
plugin_dir=$rc_dir/plugins

function createdir () {
    if [ -e $HOME/$1 ] ; then
        if ! [ -d $HOME/$1 ] ; then
            rm -f $HOME/$1
            mkdir $HOME/$1
        fi
    else
        mkdir $HOME/$1
    fi
}

createdir $rc_dir
createdir $plugin_dir

cp -v default-config.scm $HOME/$config_path
cp -v plugins/*.go $HOME/$plugin_dir
