From 6a58b7b13088f7569a47f222d9d510e804632b38 Mon Sep 17 00:00:00 2001 From: Dominik Becker Date: Mon, 29 Jun 2020 22:28:44 +0200 Subject: [PATCH] #40 added setup script to init repo --- .gitignore | 1 + setup.sh | 25 +++++++++++++++++++ .../latex.azure-pipelines.yml | 0 .../latex.gitlab-ci.yml | 0 .../tasks.json => templates/latex.tasks.json | 0 .../markdown.azure-pipelines.yml | 0 .../markdown.gitlab-ci.yml | 0 templates/markdown.tasks.json | 24 ++++++++++++++++++ 8 files changed, 50 insertions(+) create mode 100755 setup.sh rename latex.azure-pipelines.yml => templates/latex.azure-pipelines.yml (100%) rename latex.gitlab-ci.yml => templates/latex.gitlab-ci.yml (100%) rename .vscode/tasks.json => templates/latex.tasks.json (100%) rename markdown.azure-pipelines.yml => templates/markdown.azure-pipelines.yml (100%) rename markdown.gitlab-ci.yml => templates/markdown.gitlab-ci.yml (100%) create mode 100644 templates/markdown.tasks.json diff --git a/.gitignore b/.gitignore index 45d2c1f..f8c2b5e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ chapter/out.md *.iml .sublime-project .sublime-workspace +.vscode/tasks.json ## MS Office Temp Files ~$*.ppt* diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..606e578 --- /dev/null +++ b/setup.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +function write_help { + echo "Usage:" + echo " ./setup.sh markdown Setup Boilerplate for usage with Markdown" + echo " ./setup.sh latex Setup Boilerplate for usage with LaTex" +} + +if [ $# == 0 ] +then + write_help + exit 1 +fi + +if [ $1 == "markdown" ] +then + cp templates/markdown.gitlab-ci.yml ./.gitlab-ci.yml + cp templates/markdown.tasks.json ./.vscode/tasks.json +elif [ $1 == "latex" ] +then + cp templates/latex.gitlab-ci.yml ./.gitlab-ci.yml + cp templates/latex.tasks.json ./.vscode/tasks.json +else + write_help +fi diff --git a/latex.azure-pipelines.yml b/templates/latex.azure-pipelines.yml similarity index 100% rename from latex.azure-pipelines.yml rename to templates/latex.azure-pipelines.yml diff --git a/latex.gitlab-ci.yml b/templates/latex.gitlab-ci.yml similarity index 100% rename from latex.gitlab-ci.yml rename to templates/latex.gitlab-ci.yml diff --git a/.vscode/tasks.json b/templates/latex.tasks.json similarity index 100% rename from .vscode/tasks.json rename to templates/latex.tasks.json diff --git a/markdown.azure-pipelines.yml b/templates/markdown.azure-pipelines.yml similarity index 100% rename from markdown.azure-pipelines.yml rename to templates/markdown.azure-pipelines.yml diff --git a/markdown.gitlab-ci.yml b/templates/markdown.gitlab-ci.yml similarity index 100% rename from markdown.gitlab-ci.yml rename to templates/markdown.gitlab-ci.yml diff --git a/templates/markdown.tasks.json b/templates/markdown.tasks.json new file mode 100644 index 0000000..ecfae69 --- /dev/null +++ b/templates/markdown.tasks.json @@ -0,0 +1,24 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "latexmk", + "type": "shell", + "command": "${workspaceFolder}/build.sh pandoc", + "group": { + "kind": "build", + "isDefault": true + }, + "dependsOrder": "sequence", + "dependsOn": ["clean"] + }, + { + "label": "clean", + "type": "shell", + "command": "${workspaceFolder}/build.sh clean", + "group": "none", + } + ] +} \ No newline at end of file