#!/usr/bin/env bash
# Real demos for P162 "Golang Generics ([T any]) in 5 Minutes". Made on the Mac (Docker Desktop).
# Your laptop: one container from a stock Ubuntu 24.04 image (lab/Dockerfile) with Go copied in from the official
# golang image; your online checkout's Go code is in ~/cart. Each version of main.go you type waits in lab/steps and
# is 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-p162-laptop >/dev/null 2>&1 || true; }
cleanup
[ -n "${KEEP:-}" ] || trap cleanup EXIT
docker build -q -t ce-p162 lab >/dev/null
docker run -d --name ce-p162-laptop --hostname laptop ce-p162 >/dev/null
python3 demo_driver.py
