mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-11-22 23:08:30 +01: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("\${gitVersion}", gitVersion, mainFile)
|
||||
replaceToken("\${buildNumber}", Integer.parseInt(System.getProperty("BUILD_NUMBER", "-1")), mainFile)
|
||||
replaceToken("\${buildNumber}", buildNumber(), mainFile)
|
||||
replaceToken("\${branch}", branchName(), mainFile)
|
||||
}
|
||||
|
||||
fun Project.branchName(): String {
|
||||
val out = ByteArrayOutputStream()
|
||||
exec {
|
||||
commandLine = listOf("git", "rev-parse", "--abbrev-ref", "HEAD")
|
||||
standardOutput = out
|
||||
}
|
||||
fun Project.branchName(): String =
|
||||
System.getenv("GIT_BRANCH") ?: "local/dev"
|
||||
|
||||
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