fix branch name on travis

This commit is contained in:
creeper123123321 2020-07-12 16:47:56 -03:00
parent 7a1f99abdf
commit ae5ffaf711

View File

@ -12,7 +12,8 @@ group = "com.github.creeper123123321.viafabric"
val gitVersion: groovy.lang.Closure<String> by extra
val versionDetails: groovy.lang.Closure<com.palantir.gradle.gitversion.VersionDetails> by extra
version = "0.2.5-SNAPSHOT+" + try {
gitVersion() + "-" + versionDetails().branchName
val travisBranch: String? = System.getenv("TRAVIS_BRANCH") // version details doesn't work on travis
gitVersion() + "-" + if (travisBranch.isNullOrBlank()) versionDetails().branchName else travisBranch
} catch (e: Exception) {
e.printStackTrace()
"unknown"