#!/bin/sh

if [ -n "$JUPYTER_GAP_EXECUTABLE" ] ; then
  GAP=$JUPYTER_GAP_EXECUTABLE
elif [ -z "$GAP" ] ; then
  GAP=gap
fi

echo "GAP Jupyter Kernel Starting using $GAP"
exec $GAP -q -T --alwaystrace <<EOF
   LoadPackage("JupyterKernel");
   JUPYTER_KernelStart_GAP("$1");
   QUIT_GAP(0);
EOF
