Skip to content

Commit

Permalink
check that the sed completed prior to continuing
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmchiu committed Sep 9, 2024
1 parent 6ba6ba3 commit db63c99
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/generate-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ jobs:
num_pages=$(pdftk textbook_full_original.pdf dump_data | grep NumberOfPages | awk '{print $2}')
sed -i "s/161/$num_pages/" pdf-generation/numbering.tex
# Don't continue if the sed failed
if [ $? -ne 0 ]; then
echo "Error: sed command failed" >&2
exit 1
fi
pdflatex pdf-generation/numbering.tex
pdftk pdf-generation/numbering.pdf burst output pdf_numbering_output/number_%03d.pdf
pdftk textbook_full_original.pdf burst output pdf_numbering_output/page_%03d.pdf
Expand Down

0 comments on commit db63c99

Please sign in to comment.