We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
./getversion
./getversion --short
1 parent 37287a3 commit 87f9d55Copy full SHA for 87f9d55
getversion
@@ -28,13 +28,17 @@ if type git >/dev/null 2>&1 && [ -d '.git' ] ; then
28
VERSION+=+
29
VERSION+=$(git rev-parse --short HEAD)
30
fi
31
+# If not a git repository and VERSION file exists, use version string from file.
32
+elif [[ -s ./VERSION ]]; then
33
+ VERSION=$(awk -F' build ' '{print $1}' ./VERSION)
34
+ BUILDNUMBER=$(awk -F' build ' '{print $2}' ./VERSION)
35
36
37
FLAG="${1:-noflag}"
38
if [ "$FLAG" = '--short' ] ; then
39
echo "${VERSION}"
40
else
- if [ -f BUILD_NUMBER ] ; then
41
+ if [[ ${BUILDNUMBER} = 'dev' && -f BUILD_NUMBER ]] ; then
42
BUILDNUMBER=`cat BUILD_NUMBER`
43
44
echo "${VERSION} build ${BUILDNUMBER}"
0 commit comments