Trying a better way to get the git branch for file names

This commit is contained in:
tterrag1098 committed 2015-09-22 14:46:09 -04:00
1 parent e28636d571
commit 68aea70990
1 file changed
+3
+3
View File
@@ -26,6 +26,9 @@ import org.ajoberstar.grgit.Grgit
def repo = Grgit.open(project.file('.'))
project.ext.gitHash = repo.log().find().abbreviatedId
def branchname = repo.branch.getCurrent().fullName
if (branchname.contains('HEAD')) {
branchname = System.getenv("GIT_BRANCH")
}
branchname = branchname.substring(branchname.lastIndexOf('/') + 1)
boolean dev = System.getenv("RELEASE") == null || System.getenv("RELEASE").equalsIgnoreCase("false")