#!/usr/bin/env bash
# Real demos for P161 "Golang Type Assertions in 5 Minutes". Made on the Mac (Docker Desktop).
# Chris runs a barber shop; his booking program is in ~/shop. One container from a stock Ubuntu 24.04 image
# (lab/Dockerfile) with Go copied in from the official golang image. The bookings (JSON files his website and phone
# app send) and each version of the Go file he types wait in lab/ and are copied in off camera; one real interactive
# bash in a pty (demo_driver.py) and every line of output is real.
set -euo pipefail
cd "$(dirname "$0")"
cleanup() { docker rm -f ce-p161-laptop >/dev/null 2>&1 || true; }
cleanup
[ -n "${KEEP:-}" ] || trap cleanup EXIT
docker build -q -t ce-p161 lab >/dev/null
docker run -d --name ce-p161-laptop --hostname laptop ce-p161 >/dev/null
python3 demo_driver.py
