build: Fix version.sh for when it is ran from a different directory
This commit is contained in:
parent
0dcd529282
commit
c1c976179a
@ -3,5 +3,10 @@
|
|||||||
LC_ALL=C
|
LC_ALL=C
|
||||||
export LC_ALL
|
export LC_ALL
|
||||||
|
|
||||||
|
srcdir="$(dirname "$0")"
|
||||||
|
test -z "$srcdir" && srcdir=.
|
||||||
|
|
||||||
|
cd "$srcdir"
|
||||||
|
|
||||||
[ -f version ] || ( git describe --exact-match --tags $(git log -n1 --pretty='%h') 2>/dev/null || git log -n1 --pretty='%h' ) | sed 's/^v//g' | xargs printf '%s'
|
[ -f version ] || ( git describe --exact-match --tags $(git log -n1 --pretty='%h') 2>/dev/null || git log -n1 --pretty='%h' ) | sed 's/^v//g' | xargs printf '%s'
|
||||||
[ -f version ] && ( cat version 2>/dev/null ) | xargs printf '%s'
|
[ -f version ] && ( cat version 2>/dev/null ) | xargs printf '%s'
|
||||||
|
Loading…
Reference in New Issue
Block a user