[Builder] Improve error handling
This commit is contained in:
@@ -15,16 +15,16 @@ if [ -n "$EXTRA_PKGS" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$INSTALL_HELPERS" ]; then
|
if [ -n "$INSTALL_HELPERS" ]; then
|
||||||
if [ "$INSTALL_HELPERS" == "true" ]; then
|
if [ "$INSTALL_HELPERS" == "true" ]; then
|
||||||
CURR_DIR=$(pwd)
|
CURR_DIR=$(pwd)
|
||||||
mkdir ~/projects/ || true
|
mkdir ~/projects/ || true
|
||||||
cd ~/projects/
|
cd ~/projects/
|
||||||
git clone https://git.janishutz.com/janishutz/latex || true
|
git clone https://git.janishutz.com/janishutz/latex || true
|
||||||
echo "
|
echo "
|
||||||
Downloaded helpers, returning to $CURR_DIR
|
Downloaded helpers, returning to $CURR_DIR
|
||||||
"
|
"
|
||||||
cd "$CURR_DIR"
|
cd "$CURR_DIR"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
@@ -38,13 +38,13 @@ echo "
|
|||||||
Compiling document using latexmk with extra arguments: $EXTRA_ARGS
|
Compiling document using latexmk with extra arguments: $EXTRA_ARGS
|
||||||
"
|
"
|
||||||
|
|
||||||
latexmk -pdf -latexoption=-file-line-error -latexoption=-interaction=nonstopmode -shell-escape $EXTRA_ARGS > /tmp/log.txt
|
latexmk -pdf -latexoption=-file-line-error -latexoption=-interaction=nonstopmode -shell-escape $EXTRA_ARGS >/tmp/log.txt || compile_fail=1
|
||||||
|
|
||||||
if [ $? != 0 ]; then
|
if [ ${compile_fail:-0} -eq 1 ]; then
|
||||||
cat /tmp/log.txt
|
cat /tmp/log.txt
|
||||||
echo "
|
echo "
|
||||||
==> Compile has failed. See log above
|
==> Compile has failed. See log above
|
||||||
"
|
"
|
||||||
else
|
else
|
||||||
echo "Compile successful, log omitted"
|
echo "Compile successful, log omitted"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user