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
# safety first
if [[ $(pwd) == *template* ]]
then
echo "Don't run this in the template directory!"
echo "Rename the current folder or edit init.sh to do this anyways"
exit
fi
{ ## DO NOT REMOVE THIS OR EVERYTHING BLOWS UP
cat 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/\$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"
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 stylefile.sty $stylefile.sty
mv gitlab-ci.yml .gitlab-ci.yml
mv gitignore .gitignore
mv latexmkrc .latexmkrc
mv ci .ci
rm init.sh
rm -rf .git
rm config
# init new repo
git init
git submodule add https://gitlab.com/latexci/packages/LatexPackagesBuild.git
git submodule foreach git checkout master-build
mv gitmodules .gitmodules
git add .
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/