move actual template into subfolder

This commit is contained in:
Maximilian Keßler 2022-02-16 10:15:15 +01:00
parent 7c399ab03f
commit 04583c78ce
14 changed files with 26 additions and 19 deletions

View file

@ -1,11 +0,0 @@
# $course
These are the lecture notes for the '$course', taught in $term at the University of Bonn.
The [latest version][1] is availabe as a pdf download via GitLab runner.
You can also have a look at the generated [log files][2] or visit the
[gl pages][3] index directly.
[1]: $repo/$mainfile.pdf
[2]: $repo/$mainfile.log
[3]: $repo/

23
init.sh
View file

@ -1,31 +1,38 @@
#!/bin/bash #!/bin/bash
# safety first
if [[ $(pwd) == *template* ]] if [[ $(pwd) == *template* ]]
then then
echo "Don't run this in the template directory!" echo "Don't run this in the template directory!"
echo "Rename the current folder or edit init.sh to do this anyways" echo "Rename the current folder or edit init.sh to do this anyways"
exit exit
fi fi
{ ## DO NOT REMOVE THIS OR EVERYTHING BLOWS UP { ## DO NOT REMOVE THIS OR EVERYTHING BLOWS UP
cat config cat config
source config source config
cd template
find -type f | xargs sed -i "s/\$mainfile/$(printf '%s\n' "$mainfile" | sed -e 's/[\/&]/\\&/g')/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/\$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/\$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/\$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" find -type f | xargs sed -i "s/\$term/$(printf '%s\n' "$term" | sed -e 's/[\/&]/\\&/g')/g"
cd ..
# clean up meta files
rm init.sh
rm config
rm README.md
rm -rf .git
# move template files into this directory
mv "template/"* .
mv mainfile.tex $mainfile.tex mv mainfile.tex $mainfile.tex
mv stylefile.sty $stylefile.sty mv stylefile.sty $stylefile.sty
mv gitlab-ci.yml .gitlab-ci.yml
mv gitignore .gitignore # init new repo
mv latexmkrc .latexmkrc
mv ci .ci
rm init.sh
rm -rf .git
rm config
git init git init
git submodule add https://gitlab.com/latexci/packages/LatexPackagesBuild.git git submodule add https://gitlab.com/latexci/packages/LatexPackagesBuild.git
git submodule foreach git checkout master-build git submodule foreach git checkout master-build
mv gitmodules .gitmodules
git add . git add .
git commit -m "initial commit" git commit -m "initial commit"
} }

View file

View file

11
template/README.md Normal file
View file

@ -0,0 +1,11 @@
# $course
These are the lecture notes for the '$course', taught in $term at the University of Bonn.
The [latest version][1] is availabe as a pdf download via GitLab runner.
You can also have a look at the generated [log files][2] or visit the
[gl pages][3] index directly.
[1]: $repo/$mainfile.pdf
[2]: $repo/$mainfile.log
[3]: $repo/