mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-20 15:06:34 -05:00
Modernize configure.ac
This commit is contained in:
parent
c66ea18715
commit
e44fb81da2
4 changed files with 46 additions and 64 deletions
14
autover.sh
14
autover.sh
|
|
@ -1,19 +1,21 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
|
||||
if [ -f .version ]; then
|
||||
SRCDIR="${srcdir:-$(dirname "$0")}"
|
||||
|
||||
if [ -f "$SRCDIR/.version" ]; then
|
||||
# Get version from the .version file
|
||||
VERSION=$(cat .version)
|
||||
VERSION=$(cat "$SRCDIR/.version")
|
||||
fi
|
||||
|
||||
if [ -z "$VERSION" ] && [ -d .git ]; then
|
||||
if [ -z "$VERSION" ] && [ -e "$SRCDIR/.git" ]; then
|
||||
# Get version from git tags, removing the 'v' prefix
|
||||
VERSION=$(git describe --match 'v*' 2>/dev/null | sed 's/^v//')
|
||||
VERSION=$(git -C "$SRCDIR" describe --match 'v*' 2>/dev/null | sed 's/^v//')
|
||||
fi
|
||||
|
||||
if [ -z "$VERSION" ] && [ -d .git ]; then
|
||||
if [ -z "$VERSION" ] && [ -e "$SRCDIR/.git" ]; then
|
||||
# Fall back to short commit hash
|
||||
VERSION=0-$(git rev-parse --short HEAD 2>/dev/null)
|
||||
VERSION=0-$(git -C "$SRCDIR" rev-parse --short HEAD 2>/dev/null)
|
||||
fi
|
||||
|
||||
if [ -z "$VERSION" ]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue