From 4c227f115cc3a0765e87c3749b714d6fbf98203c Mon Sep 17 00:00:00 2001 From: kmbisset89 <42785343+kmbisset89@users.noreply.github.com> Date: Thu, 6 Oct 2022 11:09:12 -0500 Subject: [PATCH] Look in local properties for git root Allow users to store git root in local.properties --- src/main/groovy/nebula/plugin/release/ReleasePlugin.groovy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/groovy/nebula/plugin/release/ReleasePlugin.groovy b/src/main/groovy/nebula/plugin/release/ReleasePlugin.groovy index 79a62b36..5529f0e0 100644 --- a/src/main/groovy/nebula/plugin/release/ReleasePlugin.groovy +++ b/src/main/groovy/nebula/plugin/release/ReleasePlugin.groovy @@ -74,7 +74,10 @@ class ReleasePlugin implements Plugin { void apply(Project project) { this.project = project - def gitRoot = project.hasProperty('git.root') ? project.property('git.root') : project.rootProject.projectDir + Properties properties = new Properties() + properties.load(project.rootProject.file('local.properties').newDataInputStream()) + + def gitRoot = properties.getProperty('git.root') ? (project.hasProperty('git.root') ? project.property('git.root') : project.rootProject.projectDir) : project.rootProject.projectDir try { git = Grgit.open(dir: gitRoot)