From e849d17a69878b6510360b01f33a9c81248fa71b Mon Sep 17 00:00:00 2001 From: NotAlexNoyle Date: Mon, 16 Dec 2024 03:27:06 +0100 Subject: [PATCH] Check that custom mavenLocal is actually a directory --- build.gradle.kts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 4aefdf5..cec8ef5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,23 +14,21 @@ group = "nl.skbotnl.rewindfixog" // Declare bundle identifier. version = "1.2.1" // Declare plugin version (will be in .jar). val apiVersion = "1.19" // Declare minecraft server target version. -val selfMavenLocalRepo = System.getProperty("SELF_MAVEN_LOCAL_REPO") -var addedBootstrapRepo = false -if (selfMavenLocalRepo != null) { - val repoFile = file(selfMavenLocalRepo) - if (repoFile.exists()) { - println("Using SELF_MAVEN_LOCAL_REPO at: $selfMavenLocalRepo") +val customMavenLocal = System.getProperty("SELF_MAVEN_LOCAL_REPO") +if (customMavenLocal != null) { + val mavenLocalDir = file(customMavenLocal) + if (mavenLocalDir.isDirectory) { + println("Using SELF_MAVEN_LOCAL_REPO at: $customMavenLocal") repositories { maven { - url = uri("file://${repoFile.absolutePath}") + url = uri("file://${mavenLocalDir.absolutePath}") } } - addedBootstrapRepo = true } else { - logger.error("ERROR: You must build remapped Spigot BuildTools before compiling this plugin. Use the TrueOG Bootstrap.") + logger.error("TrueOG Bootstrap not found, defaulting to ~/.m2 for mavenLocal()") } } else { - logger.error("ERROR: You must build remapped Spigot BuildTools before compiling this plugin. Use the TrueOG Bootstrap.") + logger.error("TrueOG Bootstrap not found, defaulting to ~/.m2 to mavenLocal()") } repositories {