mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-04-30 13:02:44 +02:00
Merge pull request #584 from strukturag/improve-version
Improve get-version.sh
This commit is contained in:
commit
825d95c8d7
|
@ -4,17 +4,20 @@ ROOT="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
|
|||
|
||||
VERSION=
|
||||
if [ -s "$ROOT/../version.txt" ]; then
|
||||
VERSION=$(cat "$ROOT/../version.txt" | tr -d '[:space:]')
|
||||
VERSION=$(tr -d '[:space:]' < "$ROOT/../version.txt")
|
||||
fi
|
||||
if [ -z $VERSION ] && [ -d "$ROOT/../.git" ]; then
|
||||
if [ -z "$VERSION" ] && [ -d "$ROOT/../.git" ]; then
|
||||
TAG=$(git tag --points-at HEAD | sed 's/v//')
|
||||
if [ "$1" == "--tar" ]; then
|
||||
VERSION=$(git describe --dirty --tags --always | sed 's/debian\///g')
|
||||
elif [ -n "$TAG" ]; then
|
||||
VERSION="$TAG"
|
||||
else
|
||||
VERSION=$(git log -1 --pretty=%H)
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z $VERSION ]; then
|
||||
if [ -z "$VERSION" ]; then
|
||||
VERSION=unknown
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue