Files
Iuri Matias c9641c2f98 add executable tutorials support; convert tutorial-wrapping-c-library to an executable tutorial
add executable tutorials support; convert tutorial-wrapping-c-library to an executable tutorial

add executable tutorials

update tutorial; generate steps

clarify workdir usage

update/fix tutorial
2026-05-28 10:37:22 -04:00

17 lines
572 B
Bash
Executable File

#!/usr/bin/env bash
# Wrapper that ensures python3 + pyyaml are available via nix-shell.
# Usage: run-tutorial run <spec.yaml> [OPTIONS]
# run-tutorial generate <spec.yaml> [-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\" $*"