forked from ethereum/yellowpaper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·44 lines (28 loc) · 939 Bytes
/
build.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
41
42
43
44
#!/usr/bin/env bash
##
## Usage: build.sh [white]
##
set -e
rm -rf Options.tex
if [ -d ".git" ]; then
SHA=`git rev-parse --short --verify HEAD`
DATE=`git show -s --format="%cd" --date=short HEAD`
REV="$SHA -- $DATE"
echo "\def\YellowPaperVersionNumber{$REV}" >> Options.tex
fi
if [ "$1" == "white" ]; then
echo "\definecolor{pagecolor}{rgb}{1,1,1}" >> Options.tex
fi
echo "\newcommand{\YellowPaperVersionNumber}{$REV}" > Version.tex
if grep '=========' Paper.tex
then
echo "merge conflict?"
exit 1
fi
mkdir -p build
pdflatex -output-directory=build -interaction=errorstopmode -halt-on-error Paper.tex && \
bibtex build/Paper && \
pdflatex -output-directory=build -interaction=errorstopmode -halt-on-error Paper.tex && \
pdflatex -output-directory=build -interaction=errorstopmode -halt-on-error Paper.tex && \
pdflatex -output-directory=build -interaction=errorstopmode -halt-on-error Paper.tex && \
rm -rf Options.tex