-
Notifications
You must be signed in to change notification settings - Fork 10
/
make-proofs.sh
executable file
·40 lines (40 loc) · 1.22 KB
/
make-proofs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
pushd gh-pages
echo 'Updating gh-pages repository'
git pull
popd
echo 'Updating christmas-carols repository'
if git pull
then
cp \!full.pdf 9781475217551_content.pdf
cp \!full.pdf 9781475105896_content.pdf
echo 'Adding bookmarks to 8.5x11 version'
gs -o gh-pages/pdfs/ccc.pdf -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -f \!full.pdf pdfmarks.txt
if gs -o gh-pages/pdfs/ccc-playbook.pdf -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -c "<</EndPage {0 eq {2 mod 0 eq {[/CropBox [72 18 558 774] /PAGE pdfmark true} {[/CropBox [54 18 540 774] /PAGE pdfmark true} ifelse}{false}ifelse}>> setpagedevice" -f \!full.pdf pdfmarks.txt
# if pdfcrop \!full.pdf \!cropped.pdf && \
# gs -o gh-pages/pdfs/ccc-playbook.pdf -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -f \!cropped.pdf pdfmarks.txt
then
# rm \!cropped.pdf
pushd gh-pages
if git add pdfs/ccc-playbook.pdf pdfs/ccc.pdf
then
if git commit -m 'Updated PDFs'
then
if git push
then
echo 'Success!'
else
echo 'Error from git push --^'
fi
else
echo 'Error from git commit --^'
fi
else
echo 'Error from git add --^'
fi
popd
else
echo 'Error from gs --^'
fi
else
echo 'Error from git --^'
fi