From ab95e4fc7570305a6d6c182415d210e570ee127c Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Thu, 21 Jul 2016 07:17:51 -0700 Subject: [PATCH] Refactor. --- .../src/main/kotlin/com/beust/kobalt/BuildScript.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/BuildScript.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/BuildScript.kt index c4e41891..7f646774 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/BuildScript.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/BuildScript.kt @@ -77,10 +77,10 @@ fun glob(g: String) : IFileSpec.GlobSpec = IFileSpec.GlobSpec(g) */ @Directive fun localMaven() : String { - var result = Kobalt.INJECTOR.getInstance(KobaltSettings::class.java).localMavenRepo val pluginInfo = Kobalt.INJECTOR.getInstance(PluginInfo::class.java) - pluginInfo.localMavenRepoPathInterceptors.forEach { - result = File(it.repoPath(result.absolutePath)) + val initial = Kobalt.INJECTOR.getInstance(KobaltSettings::class.java).localMavenRepo + val result = pluginInfo.localMavenRepoPathInterceptors.fold(initial) { current, interceptor -> + File(interceptor.repoPath(current.absolutePath)) } return result.toURI().toString() }