#!/bin/sh

# has to be called inside game directory

version=$(grep "#define VERSION" src/main.cpp | cut -d "\"" -f 2 | awk '{print $2}')
echo "current version           : $version" > diffstat_$version

compver=$(ls ../ | grep -v .tar.gz | grep -B 1 $version | head -1 | cut -d "-" -f 2)
echo "version to compare against: $compver" >>  diffstat_$version

echo >> diffstat_$version

cd ..

# ignore file diffstat
diff -x diffstat\* -x changelog -x Doxyfile -E -b -w -B -r bert-$compver/ bert-$version/ | diffstat >> bert-$version/diffstat_$version

