From bad14dc89d87fba21b3ab54fb2c0db2b8d8362c5 Mon Sep 17 00:00:00 2001 From: bnnm Date: Sun, 15 Aug 2021 16:32:53 +0200 Subject: [PATCH] build: use lightweight tags too as version As autogenerated by github releases --- version-get.sh | 4 ++-- version-make.bat | 4 ++-- version-make.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/version-get.sh b/version-get.sh index 7fbea41a..c16a6518 100755 --- a/version-get.sh +++ b/version-get.sh @@ -2,12 +2,12 @@ # echo current git version (doesn't make version_auto.h) -# test if git exists +# try get version from Git (dynamic), including lightweight tags if ! command -v git > /dev/null then VERSION="unknown" else - VERSION=$(git describe --always 2>&1 | tr : _ ) + VERSION=$(git describe --tags --always 2>&1 | tr : _ ) fi # ignore git stderr "fatal: diff --git a/version-make.bat b/version-make.bat index b9a6667c..fe563b74 100644 --- a/version-make.bat +++ b/version-make.bat @@ -16,9 +16,9 @@ if not "%VERSION%"=="" set VERSION=!VERSION:^:=_! cd /d "%~dp0" -REM try get version from Git (dynamic) +REM try get version from Git (dynamic), including lightweight tags :get_version_git -for /f %%v in ('git describe --always') do set VERSION=%%v +for /f %%v in ('git describe --tags --always') do set VERSION=%%v if not "%VERSION%"=="" set VERSION=!VERSION:^:=_! if "%VERSION%"=="" goto :get_version_h if %VERSION%==%VERSION_DEFAULT% goto :get_version_h diff --git a/version-make.sh b/version-make.sh index bbc2adb8..3a0b5089 100755 --- a/version-make.sh +++ b/version-make.sh @@ -6,11 +6,11 @@ VERSION_NAME=VGMSTREAM_VERSION VERSION_FILE=version_auto.h -# try get version from Git (dynamic) +# try get version from Git (dynamic), including lightweight tags if ! command -v git > /dev/null ; then VERSION="" else - VERSION=$(git describe --always 2>&1 | tr : _ ) + VERSION=$(git describe --tags --always 2>&1 | tr : _ ) fi