We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 22917d3 + 1eb9982 commit 4cbad65Copy full SHA for 4cbad65
BlueMapCore/build.gradle.kts
@@ -28,8 +28,8 @@ fun String.runCommand(): String = ProcessBuilder(split("\\s(?=(?:[^'\"`]*(['\"`]
28
29
val gitHash = "git rev-parse --verify HEAD".runCommand()
30
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'
+val lastTag = if ("git tag".runCommand().isEmpty()) "" else "git describe --tags --abbrev=0".runCommand()
+val lastVersion = if (lastTag.isEmpty()) "dev" else lastTag.substring(1) // remove the leading 'v'
33
val commits = "git rev-list --count $lastTag..HEAD".runCommand()
34
println("Git hash: $gitHash" + if (clean) "" else " (dirty)")
35
0 commit comments