From 04583c78ce23610dfbc97c05da7cc5c9763bbca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Wed, 16 Feb 2022 10:15:15 +0100 Subject: [PATCH] move actual template into subfolder --- README.md | 11 --------- init.sh | 23 ++++++++++++------- {ci => template/.ci}/build_document.sh | 0 {ci => template/.ci}/git-info-2.sh | 0 gitignore => template/.gitignore | 0 gitlab-ci.yml => template/.gitlab-ci.yml | 0 gitmodules => template/.gitmodules | 0 latexmkrc => template/.latexmkrc | 0 Makefile => template/Makefile | 0 template/README.md | 11 +++++++++ .../export_texinputs.sh | 0 {inputs => template/inputs}/.gitkeep | 0 mainfile.tex => template/mainfile.tex | 0 stylefile.sty => template/stylefile.sty | 0 14 files changed, 26 insertions(+), 19 deletions(-) rename {ci => template/.ci}/build_document.sh (100%) rename {ci => template/.ci}/git-info-2.sh (100%) rename gitignore => template/.gitignore (100%) rename gitlab-ci.yml => template/.gitlab-ci.yml (100%) rename gitmodules => template/.gitmodules (100%) rename latexmkrc => template/.latexmkrc (100%) rename Makefile => template/Makefile (100%) create mode 100644 template/README.md rename export_texinputs.sh => template/export_texinputs.sh (100%) rename {inputs => template/inputs}/.gitkeep (100%) rename mainfile.tex => template/mainfile.tex (100%) rename stylefile.sty => template/stylefile.sty (100%) 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