#!/usr/bin/env bash # Point the site root at the latest release, falling back to nightly. # Env: WWW_ROOT (default /srv/www), SITE_SLUG (default coursebank). set -euo pipefail root="${WWW_ROOT:-/srv/www}/${SITE_SLUG:-coursebank}" if [ -e "$root/release/index.html" ]; then target="release/"; else target="nightly/"; fi printf '%s\n' "" > "$root/index.html" echo "site root -> $target"