#!/bin/bash

# load jupyter-profile script
if test -e /etc/rstudio/jupyter-profile
then
   . /etc/rstudio/jupyter-profile
fi

# session arguments
# escape backslashes in arguments to pass safely to bash below
JUPYTER_ARGS="${@//\\/\\\\}"

# run the session
/bin/bash --login $JUPYTER_PROFILE_OPTIONS -c "$JUPYTER_EXEC_COMMAND $JUPYTER_ARGS"
exit $?
