aboutsummaryrefslogtreecommitdiff
path: root/scripts/lesson-make
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-09-20 15:41:09 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2023-09-20 15:41:09 +0200
commitf0af061e14690e519a8b0fbc73eaa8615f4cd736 (patch)
tree2e674926a47a93924dfe3ff559da18c08d5190bd /scripts/lesson-make
parentf3f156361e934b73cb0e9e3077ed3ff97fb0301e (diff)
downloadunterricht-f0af061e14690e519a8b0fbc73eaa8615f4cd736.tar.gz
unterricht-f0af061e14690e519a8b0fbc73eaa8615f4cd736.zip
select targets by passing their name as arguments
Diffstat (limited to 'scripts/lesson-make')
-rwxr-xr-xscripts/lesson-make7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/lesson-make b/scripts/lesson-make
index 7db37eee..589c6a0d 100755
--- a/scripts/lesson-make
+++ b/scripts/lesson-make
@@ -7,6 +7,11 @@ done
FIND="find . -maxdepth 1 '(' -name '*.md' -o -name '*.tex' ')' -a -not -name 'Aufgabe[0-9].tex' -a -not -name '_*'"
if [[ -f "${MAKEFILE}" ]]; then
- exec make -f "${MAKEFILE}" "$@" $(eval "${FIND}" | sed -e 's/\.tex$/.pdf/g' -e 's/\.md$/.pdf/g' -e 's/slides.pdf/slides.pdf slides.pptx/')
+ TARGETS=( "$@" )
+ if [[ -z "${TARGETS[*]}" ]]; then
+ read -ra TARGETS < <(eval "${FIND}" | sed -e 's/\.tex$/.pdf/g' -e 's/\.md$/.pdf/g' -e 's/slides.pdf/slides.pdf slides.pptx/')
+ fi
+
+ exec make -f "${MAKEFILE}" "${TARGETS[@]}"
fi