mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Use System.getenv instead of System.getProperty
This commit is contained in:
parent
e1e4b5059c
commit
2a667ed096
1 changed files with 5 additions and 9 deletions
|
@ -87,16 +87,12 @@ configure<BlossomExtension> {
|
||||||
|
|
||||||
replaceToken("\${version}", "${project.version} ($gitVersion)", mainFile)
|
replaceToken("\${version}", "${project.version} ($gitVersion)", mainFile)
|
||||||
replaceToken("\${gitVersion}", gitVersion, mainFile)
|
replaceToken("\${gitVersion}", gitVersion, mainFile)
|
||||||
replaceToken("\${buildNumber}", Integer.parseInt(System.getProperty("BUILD_NUMBER", "-1")), mainFile)
|
replaceToken("\${buildNumber}", buildNumber(), mainFile)
|
||||||
replaceToken("\${branch}", branchName(), mainFile)
|
replaceToken("\${branch}", branchName(), mainFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Project.branchName(): String {
|
fun Project.branchName(): String =
|
||||||
val out = ByteArrayOutputStream()
|
System.getenv("GIT_BRANCH") ?: "local/dev"
|
||||||
exec {
|
|
||||||
commandLine = listOf("git", "rev-parse", "--abbrev-ref", "HEAD")
|
|
||||||
standardOutput = out
|
|
||||||
}
|
|
||||||
|
|
||||||
return out.toString(Charsets.UTF_8.name()).trim()
|
fun Project.buildNumber(): Int =
|
||||||
}
|
Integer.parseInt(System.getenv("BUILD_NUMBER") ?: "-1")
|
Loading…
Reference in a new issue