#!/bin/bash
# Configure the Binder image so JupyterLab starts in the workshop browser
# with the examples listed as installed and ready to open, and trusts
# them without asking, since the visitor is the one who chose the link.
# A launch link naming a workshop still opens that workshop directly.
set -euo pipefail

settings="${NB_PYTHON_PREFIX}/share/jupyter/lab/settings"

mkdir -p "$settings"

cat > "$settings/overrides.json" <<'JSON'
{
  "@jupyterlab-workshop/labextension:panel": {
    "defaultWorkshop": "",
    "browseOnStart": true,
    "workshopsDirectory": "examples",
    "trustPolicy": { "forcedLevel": "trusted" }
  }
}
JSON
