mirror of
https://github.com/markqvist/Sideband.git
synced 2025-11-09 10:45:04 -05:00
22 lines
452 B
Bash
Executable file
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
|