mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Get the version even if no tag is present
If not tag is present, git cannot describe the commit. In this case we want "none" version.
This commit is contained in:
parent
f277bf24b1
commit
51f064dbbd
1 changed files with 8 additions and 3 deletions
11
autover.sh
11
autover.sh
|
|
@ -3,12 +3,17 @@
|
|||
|
||||
if [ -d .git ]; then
|
||||
# Get version from git tags, removing the 'v' prefix
|
||||
VERSION=`git describe --match 'v*' | sed 's/^v//'`
|
||||
elif [ -f .version ]; then
|
||||
VERSION=`git describe --match 'v*' 2>/dev/null | sed 's/^v//'`
|
||||
fi
|
||||
|
||||
if [ -f .version ]; then
|
||||
# Get version from the .version file
|
||||
VERSION=`cat .version`
|
||||
else
|
||||
fi
|
||||
|
||||
if [ -z $VERSION ]; then
|
||||
VERSION="none"
|
||||
fi
|
||||
|
||||
printf '%s' "$VERSION"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue