assignments/bin/update.sh

33 lines
948 B
Bash
Executable File

#!/usr/bin/bash
# Fail on first error
set -e
# Clone repo if not already present
if [ ! -d ".assignments" ]; then
git clone gitea@gitty.informatik.hs-mannheim.de:pr2-lecture/assignments.git .assignments
mkdir -p sources/src/main/java
fi
# Sync exercises with local directory
echo "---------------------------------------------------------------"
echo "Hole neue Aufgaben und Quelltexte "
echo "---------------------------------------------------------------"
(cd .assignments && git pull origin master)
rsync --ignore-existing -raz .assignments/sources/ sources/
for dir in .assignments/Assignment_*; do
rsync --ignore-existing -raz "$dir" ./
done
# Assignment files
rsync --ignore-existing -raz --include='Assignment_*' --exclude='*' .assignments/* ./
# Libraries
rsync -raz .assignments/sources/lib/ ./sources/lib
cp .assignments/readme.md README.md
# Update the scripts
cp -R .assignments/bin ./