#!/usr/bin/env bash # Wrapper that ensures python3 + pyyaml are available via nix-shell. # Usage: run-tutorial run [OPTIONS] # run-tutorial generate [-o output.md] set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" # If python3 + yaml are already available, run directly if python3 -c "import yaml" 2>/dev/null; then exec python3 "$SCRIPT_DIR/tutorial_runner.py" "$@" fi # Otherwise, use nix-shell to provide them exec nix-shell -p python3 python3Packages.pyyaml --run \ "python3 \"$SCRIPT_DIR/tutorial_runner.py\" $*"