feat: Add build.sh/dev.sh with LANG arg

This commit is contained in:
c c 2026-09-11 12:04:24 +02:00
commit 262afbb425
5 changed files with 32 additions and 12 deletions

View file

@ -3,13 +3,23 @@
cd "$(dirname "$0")"
name="$(basename "$(pwd)")"
# Check if we want to run against a certain translation
if [ $# -lt 1 ]; then
echo "Please specify the language you want to build (eg. fr)"
exit 1
fi
TARGETLANG="$1"
SOURCEFILE="main.${TARGETLANG}.typ"
t="$(mktemp --suffix=.pdf)"
if ! typst compile --root .. ./main.typ "$t"; then
echo "Failed to compile $name/main.typ. Please fix errors and run me again."
if ! typst compile --root .. ./"$SOURCEFILE" "$t"; then
echo "Failed to compile $name/"$SOURCEFILE". Please fix errors and run me again."
exit 1
fi
echo "Initial compilation successful. Now starting watch mode. Opening $t"
xdg-open "$t"
typst watch --root .. ./main.typ "$t"
typst watch --root .. ./"$SOURCEFILE" "$t"