9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2025-12-20 15:39:36 +00:00

Update build.gradle.kts

This commit is contained in:
XiaoMoMi
2024-08-29 01:39:45 +08:00
parent c1faf0dda3
commit a060298f49

View File

@@ -37,9 +37,13 @@ subprojects {
fun versionBanner(): String { fun versionBanner(): String {
val os = ByteArrayOutputStream() val os = ByteArrayOutputStream()
project.exec { try {
commandLine = "git rev-parse --short=8 HEAD".split(" ") project.exec {
standardOutput = os commandLine = "git rev-parse --short=8 HEAD".split(" ")
standardOutput = os
}
} catch (e: ExecException) {
return "Unknown"
} }
return String(os.toByteArray()).trim() return String(os.toByteArray()).trim()
} }
@@ -51,7 +55,7 @@ fun builder(): String {
commandLine = "git config user.name".split(" ") commandLine = "git config user.name".split(" ")
standardOutput = os standardOutput = os
} }
} catch (e: Exception) { } catch (e: ExecException) {
return "Unknown" return "Unknown"
} }
return String(os.toByteArray()).trim() return String(os.toByteArray()).trim()