Skip to content

Commit 4cbad65

Browse files
committed
2 parents 22917d3 + 1eb9982 commit 4cbad65

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

BlueMapCore/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ fun String.runCommand(): String = ProcessBuilder(split("\\s(?=(?:[^'\"`]*(['\"`]
2828

2929
val gitHash = "git rev-parse --verify HEAD".runCommand()
3030
val clean = "git status --porcelain".runCommand().isEmpty()
31-
val lastTag = "git describe --tags --abbrev=0".runCommand()
32-
val lastVersion = lastTag.substring(1) // remove the leading 'v'
31+
val lastTag = if ("git tag".runCommand().isEmpty()) "" else "git describe --tags --abbrev=0".runCommand()
32+
val lastVersion = if (lastTag.isEmpty()) "dev" else lastTag.substring(1) // remove the leading 'v'
3333
val commits = "git rev-list --count $lastTag..HEAD".runCommand()
3434
println("Git hash: $gitHash" + if (clean) "" else " (dirty)")
3535

0 commit comments

Comments
 (0)