Skip to content

Commit

Permalink
ci: Fixed cli tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Sep 11, 2024
1 parent b1af502 commit 695bf91
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/libs/AutoSDK.CLI/Commands/InitializeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ private static async Task HandleAsync(
H.Resources.src_libs__SolutionName__generate_sh,
H.Resources.src_libs_Directory_Build_props,
};
var replaces = new Dictionary<string, string>();
if (addMkDocs)
{
resources.AddRange(new []
Expand All @@ -119,6 +120,11 @@ private static async Task HandleAsync(
H.Resources.src_tests_IntegrationTests_Tests_Test_cs,
});
}
else
{
replaces.Add(@"Project(""{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"") = ""$SolutionName$.IntegrationTests"", ""src\tests\IntegrationTests\$SolutionName$.IntegrationTests.csproj"", ""{592ADBC9-C951-4AF7-A163-B6C63B970B19}""
EndProject", string.Empty);
}

foreach (var resource in resources)
{
Expand Down Expand Up @@ -150,14 +156,20 @@ await File.WriteAllTextAsync(

string Replace(string content)
{
return content
var newContent = content
.Replace("$SolutionName$", solutionName, StringComparison.OrdinalIgnoreCase)
.Replace("$ApiName$", apiName, StringComparison.OrdinalIgnoreCase)
.Replace("$OpenApiSpec$", openApiSpec, StringComparison.OrdinalIgnoreCase)
.Replace("$CurrentYear$", DateTime.Now.Year.ToString(CultureInfo.InvariantCulture), StringComparison.OrdinalIgnoreCase)
.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;
}
}
}

0 comments on commit 695bf91

Please sign in to comment.