From 3aacb2d5ae8fde3b9a4a0d14cb56c9aee15a00b0 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 11 Jan 2021 15:54:58 +0300 Subject: [PATCH] Update RemoveProjectFromSolutionStep.cs --- .../Building/Steps/RemoveProjectFromSolutionStep.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs index 6026ea96ca..942dd91067 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveProjectFromSolutionStep.cs @@ -26,6 +26,11 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps { SetSolutionAndProjectPathsIfNull(context); + if (_solutionFilePath == null || _projectFolderPath == null) + { + return; + } + new RemoveFolderStep(_projectFolderPath).Execute(context); var solutionFile = context.GetFile(_solutionFilePath); solutionFile.NormalizeLineEndings(); @@ -84,12 +89,12 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps if (_solutionFilePath == null) { _solutionFilePath = context.FindFile("/aspnet-core/MyCompanyName.MyProjectName.sln")?.Name ?? - context.FindFile("/MyCompanyName.MyProjectName.sln").Name; + context.FindFile("/MyCompanyName.MyProjectName.sln")?.Name; } if (_projectFolderPath == null) { _projectFolderPath = context.FindFile("/aspnet-core/src/" + _projectName.EnsureEndsWith('/'))?.Name ?? - context.FindFile("/src/" + _projectName.EnsureEndsWith('/')).Name; + context.FindFile("/src/" + _projectName.EnsureEndsWith('/'))?.Name; } } }