From 74a91a1dbf9b34e9f027a89447f7510efc83f887 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Tue, 12 Nov 2024 01:16:14 +0100 Subject: [PATCH] =?utf8?q?Script=20`COPY.sh`=20zum=20Kopieren=20der=20Quel?= =?utf8?q?len=20f=C3=BCr=20die=20Schulung=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- COPY.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 COPY.sh diff --git a/COPY.sh b/COPY.sh new file mode 100755 index 0000000..7ddcc73 --- /dev/null +++ b/COPY.sh @@ -0,0 +1,30 @@ +#!/bin/bash +set -e + +VORLAGEN=../vorlagen +MUSTERLOESUNGEN=../spickzettel + +source BRANCHES.sh + +git checkout grundlagen/docker +mkdir -p $VORLAGEN/grundlagen/docker/ +rsync -av --exclude=.git --exclude=target --exclude=.idea --exclude=BRANCHES.sh --exclude=BUILD.sh --exclude=COPY.sh --exclude=DIFF.sh --exclude=.gitignore --exclude=PUSH.sh --exclude=REBASE.sh --exclude=RESET.sh . $VORLAGEN/grundlagen/docker/ + +for i in $BRANCHES; +do + declare -n branch=${i} + git checkout $branch + if [[ $branch =~ "--vorlage" ]] + then + vorlage=$(echo $branch |sed -e 's/--vorlage$//') + echo "Vorlage: $vorlage" + mkdir -p $VORLAGEN/$vorlage/ + rsync -av --exclude=.git --exclude=target --exclude=.idea --exclude=BRANCHES.sh --exclude=BUILD.sh --exclude=COPY.sh --exclude=DIFF.sh --exclude=.gitignore --exclude=PUSH.sh --exclude=REBASE.sh --exclude=RESET.sh . $VORLAGEN/$vorlage/ + else + echo "Lösung: $branch" + mkdir -p $MUSTERLOESUNGEN/$branch/ + rsync -av --exclude=.git --exclude=target --exclude=.idea --exclude=BRANCHES.sh --exclude=BUILD.sh --exclude=COPY.sh --exclude=DIFF.sh --exclude=.gitignore --exclude=PUSH.sh --exclude=REBASE.sh --exclude=RESET.sh . $MUSTERLOESUNGEN/$branch/ + fi +done + + -- 2.20.1