Skip to content
Permalink
Browse files

fix shell script issues

  • Loading branch information
squinky86 committed Mar 9, 2020
1 parent c01a5f2 commit dd5af896804d37af5a8b10ae74d89d00085b3144
Showing with 15 additions and 2 deletions.
  1. +15 −2 doc/build.sh
@@ -23,20 +23,33 @@ function exists {
}

function lbll {
lualatex "$1" && biber "$1" && lualatex "$1" && lualatex "$1"
echo -n "Building $1..."
buf=$(mktemp)
lualatex "$1" >> $buf && biber "$1" >> $buf && lualatex "$1" >> $buf && lualatex "$1" >> $buf
if [ $? -eq 0 ]; then
echo "OK!"
else
echo "FAILED!"
tail -n 100 $buf
fi
if exists pdfsizeopt 1; then
echo -n "Compressing $1..."
OPTS=""
if exists pngwolf 1; then
OPTS="--use-image-optimizer=pngwolf"
fi
if exists advpng 1; then
OPTS="${OPTS} --use-image-optimizer=advpng4"
fi
pdfsizeopt $OPTS "$1.pdf"
pdfsizeopt $OPTS "$1.pdf" >> $buf
if [ -f "${1}.pso.pdf" ]; then
echo "OK!"
mv "${1}.pso.pdf" "${1}.pdf"
else
echo "FAILED!"
fi
fi
rm $buf
}

exists lualatex

0 comments on commit dd5af89

Please sign in to comment.
You can’t perform that action at this time.