Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a test script #15

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions _files/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/bash

for nb in *.md;
do
if [ "$nb" = "README.md" ] || [ "$nb" = "introduction.md" ] || [ ${nb} = "CHANGES.md" ] ; then
continue
fi
nbroot=$(echo "${nb}" | cut -d. -f1)
printf "================\nProcessing ${nbroot}\n"
date
if [ ! -d "${nbroot}.out" ]; then
mkdir "${nbroot}.out"
fi
cd "${nbroot}.out"
if [ -f "00_success" ]; then
echo "Found previous successful run; skipping"
cd ..
continue
elif [ -f "00_failure" ]; then
echo "Found previous failed run; skipping"
cd ..
continue
fi
cp "../${nb}" . || (echo "Cannot find ../${nb}; exiting" ; exit 1)
jupytext --execute --to notebook "${nb}" "${nbroot}.ipynb" > output.log 2>&1 || (echo "ERROR: Exit Code: $?" ; tail output.log ; touch 00_failure; exit 1)
touch 00_success
cd ..
done
date
echo "\n============\nDone"