Skip to content

Commit

Permalink
Update build.gradle.kts
Browse files Browse the repository at this point in the history
  • Loading branch information
kvc0 authored Jul 21, 2022
1 parent 2a84918 commit 40a2d48
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@ val ossrhUsername = System.getenv("OSSRH_USERNAME")
val ossrhPassword = System.getenv("OSSRH_PASSWORD")

fun gitVersion(): String {
val stdout = java.io.ByteArrayOutputStream()
exec {
commandLine = listOf("git", "describe", "--tags")
standardOutput = stdout
try {
val stdout = java.io.ByteArrayOutputStream()
exec {
commandLine = listOf("git", "describe", "--tags")
standardOutput = stdout
}
return stdout.toString().trim()
} catch (e: Exception) {
print("git failed: $e")
return "unknown"
}
return stdout.toString().trim()
}

nexusPublishing {
Expand Down

0 comments on commit 40a2d48

Please sign in to comment.