#!/bin/bash

# This runs when binder is launched

date > .startup.log
jupytext -k python3 $HOME/notebooks/*py
jupytext -s $HOME/notebooks/*{py,md}

sed -i -e "s|__JUPYTERHUB_USER__|${JUPYTERHUB_USER}|g" $HOME/.config/dask/dask.yaml
sed -i -e "s|__JUPYTERHUB_USER__|${JUPYTERHUB_USER}|g" $HOME/.jupyter/lab/workspaces/demo-*

exec "$@"
