Skip to content

Commit 03b8dcf

Browse files
committed
Derp
1 parent 1dcb298 commit 03b8dcf

1 file changed

Lines changed: 14 additions & 9 deletions

File tree

bot/build.gradle.kts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,24 @@ val getGitHashTask = tasks.register<Exec>("getGitHash") {
9595

9696
ext.set("gitVersionOut", getter)
9797

98-
return@register
99-
}
98+
commandLine("echo", "'hi'")
99+
} else {
100+
val stdout = ByteArrayOutputStream()
100101

101-
val stdout = ByteArrayOutputStream()
102+
commandLine("git", "rev-parse", "--short", "HEAD")
103+
standardOutput = stdout
104+
isIgnoreExitValue = true
102105

103-
commandLine("git", "rev-parse", "--short", "HEAD")
104-
standardOutput = stdout
106+
val getter: () -> String = {
107+
val item = standardOutput.toString().trim()
105108

106-
val getter: () -> String = {
107-
standardOutput.toString().trim()
108-
}
109+
item.ifBlank {
110+
"DEV"
111+
}
112+
}
109113

110-
ext.set("gitVersionOut", getter)
114+
ext.set("gitVersionOut", getter)
115+
}
111116
}
112117

113118
val printVersion = tasks.register<Task>("printVersion") {

0 commit comments

Comments
 (0)