From cdbfbbf06abad0a44ca94436e375d8b2c52016af Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 25 Sep 2020 14:30:08 +0000 Subject: [PATCH] dynamically resolve latex path --- entrypoint.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 2526581..790fa67 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -15,11 +15,16 @@ if [ ! -f $1 ]; then fi # install packages; add latex-related packages only if enabled -PACKAGES="doxygen graphviz ttf-freefont" if [ ! -z $3 ] ; then - if [ "$3" = true ] ; then - PACKAGES="$PACKAGES perl build-base texlive-full biblatex" - fi + BUILD_LATEX=$3 && $(grep -q GENERATE_LATEX\\s\*=\\s\*YES $1) + LATEX_DIR="$(sed -n -e 's/^OUTPUT_DIRECTORY\s*=\s*//p' Doxyfile)/$(sed -n -e 's/^LATEX_OUTPUT\s*=\s*//p' Doxyfile)" +else; then + BUILD_LATEX=0 +fi + +PACKAGES="doxygen graphviz ttf-freefont" +if [ "$BUILD_LATEX" = true ] ; then + PACKAGES="$PACKAGES perl build-base texlive-full biblatex" fi apk add $PACKAGES @@ -27,9 +32,7 @@ apk add $PACKAGES doxygen $1 # if enabled, make latex pdf output -if [ ! -z $3 ] ; then - if [ "$3" = true ] ; then - cd $2/docs/latex - make - fi +if [ "$BUILD_LATEX" = true ] ; then + cd $LATEX_DIR + make fi