nextcloud-spreed-signaling/scripts/get-version.sh
Joachim Bauch 5dcfeda1e9
Initial commit of the OpenSource version.
This corresponds to nextcloud-spreed-signaling 0.0.13
2020-05-12 09:46:20 +02:00

22 lines
475 B
Bash
Executable file

#!/bin/bash
set -e
ROOT="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
VERSION=
if [ -s "$ROOT/../version.txt" ]; then
VERSION=$(cat "$ROOT/../version.txt" | tr -d '[:space:]')
fi
if [ -z $VERSION ] && [ -d "$ROOT/../.git" ]; then
if [ "$1" == "--tar" ]; then
VERSION=$(git describe --dirty --tags --always | sed 's/debian\///g')
else
VERSION=$(git log -1 --pretty=%H)
fi
fi
if [ -z $VERSION ]; then
VERSION=unknown
fi
echo $VERSION