File: autover.sh

package info (click to toggle)
snapraid 11.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,992 kB
  • sloc: ansic: 43,597; makefile: 989; sh: 137
file content (19 lines) | stat: -rwxr-xr-x 331 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
#

if [ -d .git ]; then
    # Get version from git tags, removing the 'v' prefix
    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`
fi

if [ -z $VERSION ]; then
    VERSION="none"
fi

printf '%s' "$VERSION"