🏠
Working from home
Highlights
Block or Report
Block or report michaelbel
Report abuse
Contact GitHub support about this user’s behavior. Learn more about reporting abuse.
Report abusePinned
-
-
-
Git commits count as version code (G...
Git commits count as version code (Groovy & Kotlin implementation) 1static def gitVersion() {
2def result = "git rev-list HEAD --count".execute().text.trim() // unix
3if (result.empty) result = "PowerShell -Command git rev-list HEAD --count".execute().text.trim() // windows
4if (result.empty) throw new RuntimeException("Could not generate versioncode on this platform? Cmd output: ${result.text}")
5return result.toInteger()
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.