if [ "$SAGE_LOCAL" = "" ]; then
   echo "SAGE_LOCAL undefined ... exiting";
   echo "Maybe run 'sage -sh'?"
   exit 1
fi

cd src/

sdh_pip_install .

if [ $? -ne 0 ]; then
   echo "Error installing SageTeX."
   exit 1
fi

echo "Removing old SageTex version(s)"
rm -rf $SAGE_LOCAL/share/texmf/tex/generic/sagetex
