Skip to content

Commit f426ab2

Browse files
authored
Allow caching for files in subdirectories. (#220)
Also enable HTML output.
1 parent 5953448 commit f426ab2

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

build.sh

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -765,17 +765,18 @@ do_pdf() {
765765
# Write any LaTeX errors to stderr.
766766
>&2 grep -A 5 "] ! " "${logfile}"
767767

768-
# Copy aux, lof, lot, toc, upa, and upb files (if any) back to the source directory so they can be cached and speed up future runs.
769-
cp *.aux "${SOURCE_DIR}" 2>/dev/null
770-
cp *.lof "${SOURCE_DIR}" 2>/dev/null
771-
cp *.lot "${SOURCE_DIR}" 2>/dev/null
772-
cp *.toc "${SOURCE_DIR}" 2>/dev/null
773-
cp *.upa "${SOURCE_DIR}" 2>/dev/null
774-
cp *.upb "${SOURCE_DIR}" 2>/dev/null
775-
# Copy converted images so they can be cached as well.
776-
cp *.convert.pdf "${SOURCE_DIR}" 2>/dev/null
777-
cp *.mermaid.pdf "${SOURCE_DIR}" 2>/dev/null
778-
cp *.aasvg.pdf "${SOURCE_DIR}" 2>/dev/null
768+
# Copy generated files (if any) back to the source directory so they can be cached and speed up future runs.
769+
find . -type f \( \
770+
-name "*.aux" -o \
771+
-name "*.lof" -o \
772+
-name "*.lot" -o \
773+
-name "*.toc" -o \
774+
-name "*.upa" -o \
775+
-name "*.upb" -o \
776+
-name "*.convert.pdf" -o \
777+
-name "*.mermaid.pdf" -o \
778+
-name "*.aasvg.pdf" \
779+
\) -exec cp --parents {} "${SOURCE_DIR}" \; 2>/dev/null
779780
echo "Elapsed time: $(($end-$start)) seconds"
780781
# Write any LaTeX errors to stderr.
781782
>&2 grep -A 5 "! " "${logfile}"
@@ -907,6 +908,11 @@ if [ -n "${PDF_OUTPUT}" ]; then
907908
fi
908909
fi
909910

911+
# Generate the html output
912+
if [ -n "${HTML_OUTPUT}" ]; then
913+
do_html "${BUILD_DIR}/${INPUT_FILE}" "${SOURCE_DIR}/${HTML_OUTPUT}" "${CROSSREF_TYPE}"
914+
fi
915+
910916
# Generate the docx output
911917
if [ -n "${DOCX_OUTPUT}" ]; then
912918
do_docx "${BUILD_DIR}/${INPUT_FILE}" "${SOURCE_DIR}/${DOCX_OUTPUT}"

0 commit comments

Comments
 (0)