Get version script: allow running without path parameter

This commit is contained in:
o9000 2017-06-26 22:34:48 +02:00
parent cb174592be
commit 425036adc9

View file

@ -33,10 +33,10 @@ then
fi
VERSION=$(git describe --exact-match 2>/dev/null || echo "$MAJOR-git$(git show -s --pretty=format:%ci | cut -d ' ' -f 1 | tr -d '-').$(git show -s --pretty=format:%h)")$DIRTY
else
VERSION=$(head -n 1 ${2}ChangeLog | cut -d ' ' -f 2)
if [ $VERSION = "master" ]
VERSION=$( (head -n 1 ${2}ChangeLog || head -n 1 ../ChangeLog) | cut -d ' ' -f 2)
if [ "$VERSION" = "master" ]
then
VERSION=$VERSION-$(head -n 1 ${2}ChangeLog | cut -d ' ' -f 1)
VERSION=$VERSION-$( (head -n 1 ${2}ChangeLog || head -n 1 ../ChangeLog) | cut -d ' ' -f 1)
fi
fi