File: version.sh

package info (click to toggle)
tinyproxy 1.11.1-2.1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,668 kB
  • sloc: ansic: 6,347; sh: 4,493; perl: 351; makefile: 182
file content (19 lines) | stat: -rwxr-xr-x 399 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"
GIT_DIR="${SCRIPT_DIR}/../.git"

if test -d "${GIT_DIR}" ; then
	if type git >/dev/null 2>&1 ; then
		gitstr=$(git describe --match '[0-9]*.[0-9]*.*' 2>/dev/null)
		if test "x$?" != x0 ; then
			sed 's/$/-git/' < VERSION
		else
			printf "%s\n" "$gitstr" | sed -e 's/-g/-git-/'
		fi
	else
		sed 's/$/-git/' < VERSION
	fi
else
	cat VERSION
fi