#!/usr/bin/env bash
# Real demos for P153 "Golang Method Receivers in 5 Minutes". Made on the Mac (Docker Desktop).
# Jim keeps his little league team's season tool in Go, ~/league. One container from a stock Ubuntu 24.04 image
# (lab/Dockerfile) with Go copied in from the official golang image. Each version of main.go he types in his editor
# waits in lab/steps/<name>/main.go and is copied in off camera; every command shown is typed into a 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-p153-laptop >/dev/null 2>&1 || true; }
cleanup
[ -n "${KEEP:-}" ] || trap cleanup EXIT
docker build -q -t ce-p153 lab >/dev/null
docker run -d --name ce-p153-laptop --hostname laptop ce-p153 >/dev/null
python3 demo_driver.py
