diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2022-05-15 04:57:12 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2022-05-15 04:57:37 -0600 |
| commit | d279b7615c8a143c44b71a924802a3dc4b79e3a1 (patch) | |
| tree | 61349af5572e23122ab8888899a1d74c27c93bd3 /scripts | |
| parent | a244585622341aef73a4dc3d061809514ac1487c (diff) | |
rework script that generates reference files for arrange block so output is reproducible [no ci]
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/generate-arrange-block-reference-files.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/generate-arrange-block-reference-files.sh b/scripts/generate-arrange-block-reference-files.sh index 1a076a4d..a41cfaf2 100755 --- a/scripts/generate-arrange-block-reference-files.sh +++ b/scripts/generate-arrange-block-reference-files.sh @@ -5,11 +5,13 @@ mkdir -p sandbox/gen cd sandbox/gen echo -e 'source "https://rubygems.org"\n\ngem "hexapdf"' > Gemfile bundle --path=.bundle/gems +sed -i 's/update_fields: true/update_fields: false/' $(bundle exec gem which hexapdf/document) + cd - for adoc in spec/fixtures/arrange-block-*.adoc; do base=${adoc##*/} pdf="${base%.*}.pdf" - bundle exec asciidoctor-pdf -D sandbox/gen -a source-highlighter=rouge -a nofooter $adoc + bundle exec asciidoctor-pdf -D sandbox/gen -a reproducible -a source-highlighter=rouge -a nofooter $adoc cd sandbox/gen bundle exec hexapdf optimize --force $pdf ../../spec/reference/$pdf cd - @@ -17,9 +19,12 @@ done adoc=spec/fixtures/arrange-block-below-top-does-not-fit.adoc pdf=arrange-block-below-top-does-not-fit-prepress.pdf -bundle exec asciidoctor-pdf -o sandbox/gen/$pdf -a source-highlighter=rouge -a nofooter -d book -a media=prepress $adoc +bundle exec asciidoctor-pdf -o sandbox/gen/$pdf -a reproducible -a source-highlighter=rouge -a nofooter -d book -a media=prepress $adoc cd sandbox/gen bundle exec hexapdf optimize --force $pdf ../../spec/reference/$pdf cd - +for file in spec/reference/arrange-block-*.pdf; do + ruby -e "File.binwrite '$file', ((File.binread '$file').sub %r/\/ID\[.*\]\/Type/, '/ID[<9AA982E8DC3A53FE1E1E3D1BD0933F99><9AA982E8DC3A53FE1E1E3D1BD0933F99>]/Type')" +done rm -rf sandbox/gen |
