lecture-notes/init.sh

22 lines
803 B
Bash
Raw Normal View History

2022-02-15 23:24:20 +01:00
#!/bin/bash
2022-02-15 23:39:10 +01:00
{ ## DO NOT REMOVE THIS OR EVERYTHING BLOWS UP
2022-02-15 23:20:19 +01:00
source config
2022-02-15 23:35:05 +01:00
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"
2022-02-15 23:50:22 +01:00
mv mainfile.tex $mainfile.tex
mv stylefile.tex $stylefile.tex
mv gitlab-ci.yml .gitlab-ci.yml
mv gitignore .gitignore
mv gitmodules .gitmodules
mv latexmkrc .latexmkrc
mv ci .ci
2022-02-15 23:39:10 +01:00
rm init.sh
rm -rf .git
git init
git add .
git commit -m "initial commit"
2022-02-15 23:29:07 +01:00
}