MarkdownResume-Pipeline/vendor/git.knownelement.com/ExternalVendorCode/pandoc-latex-template/tests/build-tests.sh
Charles N Wyble 7b590fdfa5 Add "pandoc-latex-template" from "https://git.knownelement.com/ExternalVendorCode/pandoc-latex-template.git@master"
git-vendor-name: pandoc-latex-template
git-vendor-dir: vendor/git.knownelement.com/ExternalVendorCode/pandoc-latex-template
git-vendor-repository: https://git.knownelement.com/ExternalVendorCode/pandoc-latex-template.git
git-vendor-ref: master
2024-12-09 12:37:41 -06:00

39 lines
773 B
Bash

#!/bin/bash
set -e
echo "##"
echo "# building tests"
echo "##"
echo ""
containsElement () {
local e match="$1"
shift
for e; do [[ "$e" == "$match" ]] && return 0; done
return 1
}
# these examples are skipped because they don't run in CI builds (for now)
skippedExamples=()
# loop all files in the current folder
for f in *; do
# run only for folders
if [ -d "$f" ]; then
if containsElement "$f" "${skippedExamples[@]}"; then
echo "skipping '$f'"
echo ""
else
echo "building '$f'"
cd "$f"
echo " - running pandoc build script"
bash "$PWD/build.sh"
echo " - generating preview"
pdftoppm -r 150 -png "document.pdf" > "preview.png"
echo ""
cd ".."
fi
fi
done