From 558ab03cb82f3eeb50314d98b4bea8cf4f9ca02c Mon Sep 17 00:00:00 2001 From: HavenDV Date: Wed, 11 Sep 2024 05:16:22 +0400 Subject: [PATCH] ci: Fixed cli tests. --- src/libs/AutoSDK.CLI/Commands/InitializeCommand.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/libs/AutoSDK.CLI/Commands/InitializeCommand.cs b/src/libs/AutoSDK.CLI/Commands/InitializeCommand.cs index 0f148921af..eb6d303498 100644 --- a/src/libs/AutoSDK.CLI/Commands/InitializeCommand.cs +++ b/src/libs/AutoSDK.CLI/Commands/InitializeCommand.cs @@ -156,7 +156,14 @@ await File.WriteAllTextAsync( string Replace(string content) { - var newContent = content + var newContent = content; + + foreach (var (key, value) in replaces) + { + newContent = newContent.Replace(key, value, StringComparison.OrdinalIgnoreCase); + } + + newContent = newContent .Replace("$SolutionName$", solutionName, StringComparison.OrdinalIgnoreCase) .Replace("$ApiName$", apiName, StringComparison.OrdinalIgnoreCase) .Replace("$OpenApiSpec$", openApiSpec, StringComparison.OrdinalIgnoreCase) @@ -164,10 +171,6 @@ string Replace(string content) .Replace("$CompanyName$", company, StringComparison.OrdinalIgnoreCase) .Replace("$SolutionNameUppercase$", solutionName.ToUpperInvariant(), StringComparison.OrdinalIgnoreCase) ; - foreach (var (key, value) in replaces) - { - newContent = newContent.Replace(key, value, StringComparison.OrdinalIgnoreCase); - } return newContent; }