Skip to content

Commit

Permalink
remove hash from git describe
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobharder committed Feb 25, 2024
1 parent cf24c2a commit 9a6c460
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 29 deletions.
30 changes: 16 additions & 14 deletions source/Burntime.MonoGame/get-file-version.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@
:: v1.2.3-1-asdf -> 1.2.3.1
:: v1.2-1-asdf -> 1.2.0.1

FOR /F "tokens=1-3 delims==v-" %%i IN ('git describe --tags') DO (
IF "%%j%%k" == "" (
echo %%i
)
IF NOT "%%j" == "" (
IF "%%k" == "" (
FOR /F "tokens=1 delims==v+" %%n IN ('git describe --tags') DO (
FOR /F "tokens=1-3 delims==-" %%i IN ("%%n") DO (
IF "%%j%%k" == "" (
echo %%i
)
IF NOT "%%k" == "" (
FOR /F "tokens=1-3 delims==." %%s IN ("%%i") DO (
IF "%%u" == "" (
echo %%i.0.%%j
)
IF NOT "%%u" == "" (
echo %%i.%%j
IF NOT "%%j" == "" (
IF "%%k" == "" (
echo %%i
)
IF NOT "%%k" == "" (
FOR /F "tokens=1-3 delims==." %%s IN ("%%i") DO (
IF "%%u" == "" (
echo %%i.0.%%j
)
IF NOT "%%u" == "" (
echo %%i.%%j
)
)
)
)
)
)
)
2 changes: 1 addition & 1 deletion source/Burntime.MonoGame/get-product-version.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
:: v1.2.3-rc1 -> 1.2.3-rc1
:: v1.2.3-1-asdf -> 1.2.3-1-asdf

FOR /F "tokens=1-2 delims==v" %%i IN ('git describe --tags') DO (
FOR /F "tokens=1-2 delims==v+" %%i IN ('git describe --tags') DO (
echo %%i
)
31 changes: 17 additions & 14 deletions source/Burntime.MonoGame/get-semver-version.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,25 @@
:: v1.2.3-rc1 -> 1.2.3-rc1
:: v1.2.3-1-asdf -> 1.2.3.1
:: v1.2-1-asdf -> 1.2.0.1
:: v1.2.3-rc1+abc -> 1.2.3-rc1

FOR /F "tokens=1-3 delims==v-" %%i IN ('git describe --tags') DO (
IF "%%j%%k" == "" (
echo %%i
)
IF NOT "%%j" == "" (
IF "%%k" == "" (
echo %%i-%%j
FOR /F "tokens=1 delims==v+" %%n IN ('git describe --tags') DO (
FOR /F "tokens=1-3 delims==-" %%i IN ("%%n") DO (
IF "%%j%%k" == "" (
echo %%i
)
IF NOT "%%k" == "" (
FOR /F "tokens=1-3 delims==." %%s IN ("%%i") DO (
IF "%%u" == "" (
echo %%i.0.%%j
)
IF NOT "%%u" == "" (
echo %%i.%%j
IF NOT "%%j" == "" (
IF "%%k" == "" (
echo %%i-%%j
)
IF NOT "%%k" == "" (
FOR /F "tokens=1-3 delims==." %%s IN ("%%i") DO (
IF "%%u" == "" (
echo %%i.0.%%j
)
IF NOT "%%u" == "" (
echo %%i.%%j
)
)
)
)
Expand Down

0 comments on commit 9a6c460

Please sign in to comment.