diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-04-12 11:29:11 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-04-12 11:29:11 +0200 |
| commit | e536f7265cb617abaa5c97efe5d86f222291d983 (patch) | |
| tree | 202ba404c48465b3e2f306318a8dd3c099685359 | |
| parent | 0995dd2aa91c41d822ca552ec04ba47c71d90a66 (diff) | |
| download | unterricht-e536f7265cb617abaa5c97efe5d86f222291d983.tar.gz unterricht-e536f7265cb617abaa5c97efe5d86f222291d983.zip | |
add a template initialization script
Move all scripts into scripts/.
Use the common 'lesson-' prefix.
| -rw-r--r-- | Makefile | 2 | ||||
| -rwxr-xr-x | scripts/lesson-cp | 9 | ||||
| -rwxr-xr-x | scripts/lesson-make (renamed from make-lesson) | 0 |
3 files changed, 10 insertions, 1 deletions
@@ -20,7 +20,7 @@ all: $(SRC_DIRS) define generateRules $(1): @echo \#\# Building $$@ \#\# - @pushd $$(@) >/dev/null && make-lesson || popd >/dev/null + @pushd $$(@) >/dev/null && lesson-make || popd >/dev/null endef $(foreach dir, $(SRC_DIRS), $(eval $(call generateRules, $(dir)))) diff --git a/scripts/lesson-cp b/scripts/lesson-cp new file mode 100755 index 00000000..060da2fc --- /dev/null +++ b/scripts/lesson-cp @@ -0,0 +1,9 @@ +#!/bin/bash +template_dir="templates" +while [[ ! -d "${template_dir}" ]]; do + template_dir=../"${template_dir}" +done + +for template in "$@"; do + cp "${template_dir}/${template}" . +done diff --git a/make-lesson b/scripts/lesson-make index a82776d6..a82776d6 100755 --- a/make-lesson +++ b/scripts/lesson-make |
