diff --git a/README.md b/README.md index 349458c..e69de29 100644 --- a/README.md +++ b/README.md @@ -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/ diff --git a/init.sh b/init.sh index 32076bd..41bff2a 100755 --- a/init.sh +++ b/init.sh @@ -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" } diff --git a/ci/build_document.sh b/template/.ci/build_document.sh similarity index 100% rename from ci/build_document.sh rename to template/.ci/build_document.sh diff --git a/ci/git-info-2.sh b/template/.ci/git-info-2.sh similarity index 100% rename from ci/git-info-2.sh rename to template/.ci/git-info-2.sh diff --git a/gitignore b/template/.gitignore similarity index 100% rename from gitignore rename to template/.gitignore diff --git a/gitlab-ci.yml b/template/.gitlab-ci.yml similarity index 100% rename from gitlab-ci.yml rename to template/.gitlab-ci.yml diff --git a/gitmodules b/template/.gitmodules similarity index 100% rename from gitmodules rename to template/.gitmodules diff --git a/latexmkrc b/template/.latexmkrc similarity index 100% rename from latexmkrc rename to template/.latexmkrc diff --git a/Makefile b/template/Makefile similarity index 100% rename from Makefile rename to template/Makefile diff --git a/template/README.md b/template/README.md new file mode 100644 index 0000000..349458c --- /dev/null +++ b/template/README.md @@ -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/ diff --git a/export_texinputs.sh b/template/export_texinputs.sh similarity index 100% rename from export_texinputs.sh rename to template/export_texinputs.sh diff --git a/inputs/.gitkeep b/template/inputs/.gitkeep similarity index 100% rename from inputs/.gitkeep rename to template/inputs/.gitkeep diff --git a/mainfile.tex b/template/mainfile.tex similarity index 100% rename from mainfile.tex rename to template/mainfile.tex diff --git a/stylefile.sty b/template/stylefile.sty similarity index 100% rename from stylefile.sty rename to template/stylefile.sty