Skip to content

Commit

Permalink
chore: Update cli.
Browse files Browse the repository at this point in the history
  • Loading branch information
colinin committed Feb 22, 2025
1 parent 3914dcf commit 1e65fa1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Version>8.3.4</Version>
<TargetFramework>net9.0</TargetFramework>
<Version>9.0.4</Version>
<Copyright>colin</Copyright>
<Description>Use LINGYUN.MicroService.Templates command line</Description>
<PackAsTool>true</PackAsTool>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ public async virtual Task CreateAsync(ProjectCreateArgs createArgs)

Logger.LogInformation("Rewrite Package and company name.");

await TryReplacePackageAndCompanyNameWithProjectFile(
await TryReplacePackageAndCompanyAndProjectNameWithProjectFile(
projectFiles,
createArgs.PackageName,
createArgs.SolutionName.CompanyName,
createArgs.SolutionName.ProjectName,
dbm);

Logger.LogInformation("Rewrite appsettings.json.");
Expand Down Expand Up @@ -231,15 +232,17 @@ protected async virtual Task TryReplaceAppSettingsWithProjectFile(
// }
// }

protected async virtual Task TryReplacePackageAndCompanyNameWithProjectFile(
protected async virtual Task TryReplacePackageAndCompanyAndProjectNameWithProjectFile(
List<FindFile> projectFiles,
string packageName,
string companyName,
string projectName,
string dbm = "MySQL")
{
var canReplaceFiles = projectFiles.Where(f => !f.IsFolder && !f.Name.Contains("appsettings"));
foreach (var projectFile in canReplaceFiles)
var canReplaceWithNotProjectFiles = projectFiles.Where(f => !f.IsFolder && !f.Name.Contains("appsettings"));
foreach (var projectFile in canReplaceWithNotProjectFiles)
{
await ReplaceFileTextAsync(projectFile, "project-name", projectName.ToKebabCase());
await ReplaceFileTextAsync(projectFile, "PackageName", packageName);
await ReplaceFileTextAsync(projectFile, "CompanyName", companyName);
await ReplaceFileTextAsync(projectFile, "DatabaseManagementName", dbm);
Expand Down

0 comments on commit 1e65fa1

Please sign in to comment.