get_revision_lib.sh 349 字节
Newer Older
V
Vasily Okunev 已提交
1 2 3 4 5 6 7
# Filter non-release tags
function tag_filter {
	grep -E "^v1\.1\.[0-9]{5}-testing$"
}

# Get last revision number
function get_revision {
8 9 10
	BASEDIR=`dirname "$0"`
	CURDIR=`pwd`
	cd ${BASEDIR}
11
	git rev-parse --git-dir 2>/dev/null || cd ${CURDIR}
V
Vasily Okunev 已提交
12 13
	git fetch --tags
	git tag | tag_filter | tail -1 | sed 's/^v1\.1\.\(.*\)-testing$/\1/'
14
	cd ${CURDIR}
V
Vasily Okunev 已提交
15
}