Sideband/libs/able/tests/notebooks/run
2025-10-29 12:54:59 +01:00

22 lines
452 B
Bash
Executable file

#!/bin/bash
set -ex
name="$1"
command="${2}"
command="${command:=test}"
cat "${name}.md" |
jupytext --execute --to ipynb |
jupyter nbconvert --stdin --no-input --to asciidoc --output "${name}"
cat "${name}".asciidoc
if [ "${command}" = "test" ]; then
diff "${name}.asciidoc" "${name}.expected"
elif [ "${command}" = "record" ]; then
cp "${name}".asciidoc "${name}".expected
else
echo "Unknown command: ${command}"
exit 1
fi