Skip to content

Commit

Permalink
Merge pull request #1119 from colinin/cli
Browse files Browse the repository at this point in the history
chore: Update cli.
  • Loading branch information
colinin authored Feb 22, 2025
2 parents 0893d24 + 1e65fa1 commit 2a31d09
Showing 1 changed file with 7 additions and 4 deletions.
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 2a31d09

Please sign in to comment.