#!/bin/bash

put() {
    echo "$1" >> $HOME/.bashrc
}

mark="# added by https://github.com/AloisMahdal/mydots"
if grep -qF "$mark" $HOME/.bashrc;
then
    echo "already set up, giving up";
    exit 1;
else
    put ''
    put '# added by https://github.com/AloisMahdal/mydots"'
    put 'test -f "${HOME}/.bash/head.bashrc" \'
    put '  &&. "${HOME}/.bash/head.bashrc"'
fi