#!/usr/bin/env bash

if [ ! -e ~/.ipython/profile_default/startup/datashell.py ]
then
    echo 'Do you wish to add the data shell config to your default IPython QtConsole profile? [y/N]'
    read answer
    case ${answer:0:1} in
        y|Y )
            mkdir -p ~/.ipython/profile_default/startup
            ln -s $(which datashell.py) ~/.ipython/profile_default/startup/datashell.py
            ln -s $(which datashell.ipy) ~/.ipython/profile_default/startup/datashell.ipy
        ;;
    esac
fi

if [ -e ~/.ipython/profile_default/startup/datashell.py ]
then
    ipython3 qtconsole
fi