From 5ec06b36fb9398179557fae9c3c8b27ffbab4688 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Mon, 9 Dec 2024 10:01:50 +0100 Subject: [PATCH] chore(conan): Move a potentially throwing call into `runCatching` Catch any exception from both `run()` calls. Signed-off-by: Sebastian Schuberth --- .../package-managers/conan/src/main/kotlin/Conan.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/package-managers/conan/src/main/kotlin/Conan.kt b/plugins/package-managers/conan/src/main/kotlin/Conan.kt index 4111f955ecb55..9bb4eaacda65c 100644 --- a/plugins/package-managers/conan/src/main/kotlin/Conan.kt +++ b/plugins/package-managers/conan/src/main/kotlin/Conan.kt @@ -227,13 +227,13 @@ class Conan( } private fun configureRemoteAuthentication(conanConfig: File?) { - // Install configuration from a local directory if available. - conanConfig?.let { - run("config", "install", it.absolutePath).requireSuccess() - } - - // List configured remotes in "remotes.txt" format. val remoteList = runCatching { + // Install configuration from a local directory if available. + conanConfig?.let { + run("config", "install", it.absolutePath).requireSuccess() + } + + // List configured remotes in "remotes.txt" format. run("remote", "list", "--raw").requireSuccess() }.getOrElse { logger.warn { "Failed to list remotes." }