-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·50 lines (44 loc) · 1008 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
45
46
47
48
49
50
#!/usr/bin/env bash
ARGS=""
UPDATE=false
usage() {
echo -e "Avabile flags:"
echo -e " -b: builds a .pdf file"
echo -e " -c: performs a \"small\" clean-up"
echo -e " -C: performs a \"big\" clean-up"
echo -e " -u: Send a SIGHUP signal to all MuPDF processes after compilation"
}
# Check if any argument was passed
if [ $# -eq 0 ]
then
echo "No arguments supplied!"
usage
exit
fi
# Parse flags
while getopts bcChu flag 2>/dev/null
do
case "${flag}" in
b) ARGS+="-pdf";;
c) ARGS+="-c";;
C) ARGS+="-C";;
u) UPDATE=true;;
h)
echo "A small script to streamline the usage of texlive docker image."
usage
exit
;;
*)
echo "Unexpected flags!"
usage
exit
;;
esac
done
# Run texlive image
sudo docker run -v $PWD:/files -w /files texlive/texlive latexmk ${ARGS}
# Send a update signall to all MuPDF instances
if $UPDATE; then
echo "Sending a SIGHUP to all MuPDF instances!"
pkill -SIGHUP mupdf
fi