From 425036adc9176307c57b15deea3d547a7684475a Mon Sep 17 00:00:00 2001 From: o9000 Date: Mon, 26 Jun 2017 22:34:48 +0200 Subject: [PATCH] Get version script: allow running without path parameter --- get_version.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/get_version.sh b/get_version.sh index 0b50561..69b6815 100755 --- a/get_version.sh +++ b/get_version.sh @@ -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