From 4e75ce9773c9743ec78cb1acb1757804e207e16e Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Thu, 10 Oct 2024 18:32:47 +0200 Subject: [PATCH] Update Proc package and simplify binary execution logic Upgraded Proc package references from various older versions to 0.8.2 across multiple projects for consistency. Removed redundant overloaded method in `IClusterComposeTask.cs` to streamline the binary execution logic. --- build/scripts/scripts.fsproj | 2 +- examples/ScratchPad/ScratchPad.csproj | 2 +- .../Tasks/IClusterComposeTask.cs | 12 +++--------- .../Elastic.Elasticsearch.Managed.csproj | 2 +- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/build/scripts/scripts.fsproj b/build/scripts/scripts.fsproj index 5220347..f54f4f8 100644 --- a/build/scripts/scripts.fsproj +++ b/build/scripts/scripts.fsproj @@ -8,7 +8,7 @@ - + diff --git a/examples/ScratchPad/ScratchPad.csproj b/examples/ScratchPad/ScratchPad.csproj index cef057c..7304372 100644 --- a/examples/ScratchPad/ScratchPad.csproj +++ b/examples/ScratchPad/ScratchPad.csproj @@ -5,7 +5,7 @@ False - + diff --git a/src/Elastic.Elasticsearch.Ephemeral/Tasks/IClusterComposeTask.cs b/src/Elastic.Elasticsearch.Ephemeral/Tasks/IClusterComposeTask.cs index 536c22d..ff91d47 100644 --- a/src/Elastic.Elasticsearch.Ephemeral/Tasks/IClusterComposeTask.cs +++ b/src/Elastic.Elasticsearch.Ephemeral/Tasks/IClusterComposeTask.cs @@ -148,14 +148,10 @@ protected static void WriteFileIfNotExist(string fileLocation, string contents) protected static void ExecuteBinary(EphemeralClusterConfiguration config, IConsoleLineHandler writer, string binary, string description, params string[] arguments) => - ExecuteBinaryInternal(config, writer, binary, description, null, arguments); - - protected static void ExecuteBinary(EphemeralClusterConfiguration config, IConsoleLineHandler writer, - string binary, string description, StartedHandler startedHandler, params string[] arguments) => - ExecuteBinaryInternal(config, writer, binary, description, startedHandler, arguments); + ExecuteBinaryInternal(config, writer, binary, description, arguments); private static void ExecuteBinaryInternal(EphemeralClusterConfiguration config, IConsoleLineHandler writer, - string binary, string description, StartedHandler startedHandler, params string[] arguments) + string binary, string description, params string[] arguments) { var command = $"{{{binary}}} {{{string.Join(" ", arguments)}}}"; writer?.WriteDiagnostic($"{{{nameof(ExecuteBinary)}}} starting process [{description}] {command}"); @@ -170,9 +166,7 @@ private static void ExecuteBinaryInternal(EphemeralClusterConfiguration config, } }; - var result = startedHandler != null - ? Proc.Start(processStartArguments, timeout, new ConsoleOutColorWriter(), startedHandler) - : Proc.Start(processStartArguments, timeout, new ConsoleOutColorWriter()); + var result = Proc.Start(processStartArguments, timeout, new ConsoleOutColorWriter()); if (!result.Completed) throw new Exception($"Timeout while executing {description} exceeded {timeout}"); diff --git a/src/Elastic.Elasticsearch.Managed/Elastic.Elasticsearch.Managed.csproj b/src/Elastic.Elasticsearch.Managed/Elastic.Elasticsearch.Managed.csproj index 06f70f1..b98af99 100644 --- a/src/Elastic.Elasticsearch.Managed/Elastic.Elasticsearch.Managed.csproj +++ b/src/Elastic.Elasticsearch.Managed/Elastic.Elasticsearch.Managed.csproj @@ -9,7 +9,7 @@ elastic,elasticsearch,cluster,observable,rx - +