Skip to content

Commit 4dd2abf

Browse files
authored
Check if grgit.describe returns null (#152)
1 parent 1cdaf91 commit 4dd2abf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

build.gradle

+3
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ def calculateVersion() {
225225
return 'UNKNOWN'
226226
}
227227
String version = grgit.describe(tags: true)
228+
if (version == null) {
229+
return "UNKNOWN+g${grgit.head().abbreviatedId}"
230+
}
228231
def versionPattern = ~/^(?<lastVersion>.*)-(?<devVersion>[0-9]+-g[a-z0-9]+)$/
229232
def matcher = version =~ versionPattern
230233
if (matcher.find()) {

0 commit comments

Comments
 (0)