File: version

package info (click to toggle)
hare 0.25.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,948 kB
  • sloc: asm: 1,264; makefile: 123; sh: 114; lisp: 101
file content (16 lines) | stat: -rwxr-xr-x 407 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
# Distro packagers may set the LOCALVER variable to add their distribution to
# the version, e.g. 1.0-alpine.
VERSION="${VERSION:-0.25.2}"

ver=$(git describe 2>/dev/null)
# shellcheck disable=SC2181
if [ $? -ne 0 ]; then
	ver="dev+$(git log -1 --format='%h' 2>/dev/null)"
	if [ $? -ne 0 ]; then
		# git presumed unavailable
		ver="$VERSION"
	fi
fi

printf -- '%s' "$ver${LOCALVER:+"-$LOCALVER"}"