Script `COPY.sh` zum Kopieren der Quellen für die Schulung hinzugefügt
authorKai Moritz <kai@juplo.de>
Tue, 12 Nov 2024 00:16:14 +0000 (01:16 +0100)
committerKai Moritz <kai@juplo.de>
Tue, 12 Nov 2024 00:16:14 +0000 (01:16 +0100)
COPY.sh [new file with mode: 0755]

diff --git a/COPY.sh b/COPY.sh
new file mode 100755 (executable)
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
+
+