Skip to content

Commit

Permalink
Fix build script not working when git repo isn't cloned (EssentialsX#…
Browse files Browse the repository at this point in the history
  • Loading branch information
JRoy authored and DarkEyeDragon committed Dec 24, 2020
1 parent e98dda2 commit c6a8faa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -20,6 +20,9 @@ allprojects {
}

def commitsSinceLastTag() {
if (grgit == null) {
return 0
}
def tags = grgit.tag.list().stream().map({it.commit}).toList()
def commit = grgit.head()
def depth = 0
@@ -32,7 +35,7 @@ def commitsSinceLastTag() {
}

ext {
GIT_COMMIT = grgit.head().abbreviatedId
GIT_COMMIT = grgit == null ? "unknown" : grgit.head().abbreviatedId
GIT_DEPTH = commitsSinceLastTag()

fullVersion = "${version}-${GIT_COMMIT}".replace("-SNAPSHOT", "-dev+${GIT_DEPTH}")

0 comments on commit c6a8faa

Please # to comment.