#!/usr/bin/env bash
# Real demos for P082 "PowerShell vs Bash: Which One Should You Learn?". Runs on render01 (Docker).
# One container, ce-p082-laptop: a stock Ubuntu 24.04 with bash and PowerShell 7 from Microsoft's package
# repository (lab/Dockerfile), the tea shop's log folder, and its orders page served on localhost:8080.
# Every command shown is typed into a real interactive shell in a pty (demo_driver.py): one bash window and one
# PowerShell window on the same laptop.
set -euo pipefail
cd "$(dirname "$0")"
P=ce-p082
cleanup() { docker rm -f $P-laptop >/dev/null 2>&1 || true; }
cleanup
[ -n "${KEEP:-}" ] || trap cleanup EXIT
docker build -q -t $P-laptop lab >/dev/null
docker run -d --name $P-laptop --hostname laptop $P-laptop >/dev/null
python3 - "$P" < demo_driver.py
