Fix git info lookup to use correct dir where git exists

This commit is contained in:
Ryan Ernst 2016-05-21 22:58:55 -07:00
parent cec4b9a71c
commit 7cf758943e
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ subprojects {
nexus {
String buildSnapshot = System.getProperty('build.snapshot', 'true')
if (buildSnapshot == 'false') {
Repository repo = new RepositoryBuilder().findGitDir(new File('.')).build()
Repository repo = new RepositoryBuilder().findGitDir(project.rootDir).build()
String shortHash = repo.resolve('HEAD')?.name?.substring(0,7)
repositoryUrl = project.hasProperty('build.repository') ? project.property('build.repository') : "file://${System.getenv('HOME')}/elasticsearch-releases/${version}-${shortHash}/"
}