-
Notifications
You must be signed in to change notification settings - Fork 177
/
Copy pathsingle.sh
executable file
·48 lines (37 loc) · 997 Bytes
/
single.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
45
46
47
48
#!/usr/bin/env bash
set -eo pipefail
if [ -z "$PLANNERGEN_BINARY" ]; then
export GO_CMD="go run cmd/plannergen/plannergen.go"
else
export GO_CMD="$PLANNERGEN_BINARY"
echo "Building using plannergen binary at \"${PLANNERGEN_BINARY}\""
fi
if [ -z "$PREVIEW" ]; then
eval $GO_CMD --config "${CFG}"
else
eval $GO_CMD --preview --config "${CFG}"
fi
nakedname=$(echo "${CFG}" | rev | cut -d, -f1 | cut -d'/' -f 1 | cut -d'.' -f 2-99 | rev)
if [ -n "${TRANSLATION}" ]; then
python3 translate.py ${TRANSLATION}
fi
_passes=(1)
if [[ -n "${PASSES}" ]]; then
# shellcheck disable=SC2207
_passes=($(seq 1 "${PASSES}"))
fi
for _ in "${_passes[@]}"; do
xelatex \
-file-line-error \
-interaction=nonstopmode \
-synctex=1 \
-output-directory=./out \
"out/${nakedname}.tex"
done
if [ -n "${NAME}" ]; then
cp "out/${nakedname}.pdf" "${NAME}.pdf"
echo "created ${NAME}.pdf"
else
cp "out/${nakedname}.pdf" "${nakedname}.pdf"
echo "created ${nakedname}.pdf"
fi