This commit is contained in:
Maximilian Keßler 2022-02-15 23:35:05 +01:00
parent e42c263a8f
commit 71ae5733ae

10
init.sh
View file

@ -1,9 +1,9 @@
#!/bin/bash
{
source config
find -type f | xargs sed -i "s/\$mainfile/${mainfile}/g"
find -type f | xargs sed -i "s/\$course/${course}/g"
find -type f | xargs sed -i "s/\$stylefile/${stylefile}/g"
find -type f | xargs sed -i "s/\$repo/${repo}/g"
find -type f | xargs sed -i "s/\$term/${term}/g"
find -type f | xargs sed -i "s/\$mainfile/$(printf '%s\n' "$mainfile" | sed -e 's/[\/&]/\\&/g')/g"
find -type f | xargs sed -i "s/\$course/$(printf '%s\n' "$course" | sed -e 's/[\/&]/\\&/g')/g"
find -type f | xargs sed -i "s/\$stylefile/$(printf '%s\n' "$stylefile" | sed -e 's/[\/&]/\\&/g')/g"
find -type f | xargs sed -i "s/\$repo/$(printf '%s\n' "$repo" | sed -e 's/[\/&]/\\&/g')/g"
find -type f | xargs sed -i "s/\$term/$(printf '%s\n' "$term" | sed -e 's/[\/&]/\\&/g')/g"
}