Skip to content

Commit

Permalink
Merge pull request #8099 from abpframework/volo/issue/5766
Browse files Browse the repository at this point in the history
Cli: add-module command improvements
  • Loading branch information
ebicoglu committed Mar 18, 2021
2 parents eb88a94 + d4659fd commit 8adee00
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using JetBrains.Annotations;
using System;
using JetBrains.Annotations;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using System.Collections.Generic;
Expand Down Expand Up @@ -174,6 +175,7 @@ private async Task RunBundleForBlazorAsync(string[] projectFiles, ModuleWithMast
{
await RemoveProjectByTarget(module, moduleSolutionFile, NuGetPackageTarget.EntityFrameworkCore, isProjectTiered);
await RemoveProjectByPostFix(module, moduleSolutionFile, "test", ".EntityFrameworkCore.Tests");
await RemoveProjectByPostFix(module, moduleSolutionFile, "test", ".Application.Tests");
ChangeDomainTestReferenceToMongoDB(module, moduleSolutionFile);
}
}
Expand Down Expand Up @@ -214,18 +216,16 @@ private async Task RunBundleForBlazorAsync(string[] projectFiles, ModuleWithMast
return;
}

var projectFolderPath = Directory.GetDirectories(srcPath).FirstOrDefault(d => d.EndsWith(postFix));
var projectFolderPaths = Directory.GetDirectories(srcPath).Where(d => d.EndsWith(postFix)).ToList();

if (projectFolderPath == null)
foreach (var projectFolderPath in projectFolderPaths)
{
return;
}

await SolutionFileModifier.RemoveProjectFromSolutionFileAsync(moduleSolutionFile, new DirectoryInfo(projectFolderPath).Name);
await SolutionFileModifier.RemoveProjectFromSolutionFileAsync(moduleSolutionFile, new DirectoryInfo(projectFolderPath).Name);

if (Directory.Exists(projectFolderPath))
{
Directory.Delete(projectFolderPath, true);
if (Directory.Exists(projectFolderPath))
{
Directory.Delete(projectFolderPath, true);
}
}
}

Expand All @@ -245,8 +245,8 @@ private void ChangeDomainTestReferenceToMongoDB(ModuleWithMastersInfo module, st
return;
}

var csprojFile = Directory.GetFiles(projectFolderPath).FirstOrDefault(p => p.EndsWith(".csproj"));
var moduleFile = Directory.GetFiles(projectFolderPath).FirstOrDefault(p => p.EndsWith("DomainTestModule.cs"));
var csprojFile = Directory.GetFiles(projectFolderPath, "*.csproj", SearchOption.AllDirectories).FirstOrDefault();
var moduleFile = Directory.GetFiles(projectFolderPath, "*DomainTestModule.cs", SearchOption.AllDirectories).FirstOrDefault();

if (csprojFile == null || moduleFile == null)
{
Expand Down

0 comments on commit 8adee00

Please sign in to comment.