#!/bin/bash set -e TRYTON_REPO="$HOME/tmp/tryton" WORKDIR="$HOME/code/tryton-db-migration" EXTRACTOR="$WORKDIR/extract.py" START='5.0' END='8.0' cd "$TRYTON_REPO" VERSIONS=$( git branch -r | sed 's|origin/||; s|^[[:space:]]*||' | grep -E '^[0-9]+\.[0-9]+$' | sort -V | awk -v start="$START" -v end="$END" ' $0 >= start && $0 <= end ' ) # echo $VERSIONS for VERSION in $VERSIONS do echo echo "======================================================" echo "Version $VERSION" echo "======================================================" git switch "$VERSION" python3 "$EXTRACTOR" --repo $TRYTON_REPO --output $WORKDIR/data done git switch $END echo echo "Fertig."