From a929f506ac32dfefd2aea3b9b23289789f8b86a3 Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Wed, 30 Oct 2024 16:19:01 +0100 Subject: [PATCH] modified gallery.bash to compile recursively --- gallery.bash | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) mode change 100644 => 100755 gallery.bash diff --git a/gallery.bash b/gallery.bash old mode 100644 new mode 100755 index 54c17e8..16e91db --- a/gallery.bash +++ b/gallery.bash @@ -16,7 +16,7 @@ cnt="$#" i=1 for f do - f2="${f/typ/png}" + f2="${f%.typ}.png" echo "($i/$cnt) $f -> $f2" typst c --root ./ "$f" "$f2" i=$((i+1)) @@ -27,12 +27,12 @@ then echo echo "Generating gallery PDFs" - set -- ./gallery/*.typ - cnt="$#" + files=$(find ./gallery -type f -name "*.typ") + cnt=$(echo "$files" | wc -l) i=1 - for f + for f in $files do - f2="${f/typ/pdf}" + f2="${f%.typ}.pdf" echo "($i/$cnt) $f -> $f2" typst c --root ./ "$f" "$f2" i=$((i+1))