From 88657a68bae9f4d9ba0ad5a3b46d5834cfff06ee Mon Sep 17 00:00:00 2001 From: Hanpaopao <510423039@qq.com> Date: Mon, 10 Feb 2025 19:50:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4cli?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Lion/AbpPro/Cli/AbpProCliCoreModule.cs | 6 +++--- .../Lion/AbpPro/Cli/Commands/CreateCommand.cs | 2 +- .../Lion/AbpPro/Cli/Commands/NewCommand.cs | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/AbpProCliCoreModule.cs b/aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/AbpProCliCoreModule.cs index 169565fd..16c514b9 100644 --- a/aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/AbpProCliCoreModule.cs +++ b/aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/AbpProCliCoreModule.cs @@ -60,7 +60,7 @@ public class AbpProCliCoreModule : AbpModule { new AbpProTemplateOptions("pro", "pro", "商业版本源码版本") { - ExcludeFiles = ".github,LICENSE,Readme.md,templates", + ExcludeFiles = ".github,LICENSE,Readme.md,templates,Lion.AbpPro.Cli.sln", ReplaceSuffix = ".sln,.csproj,.cs,.cshtml,.json,.ci,.yml,.yaml,.nswag,.DotSettings,.env,Directory.Build.Lion.targets", OldCompanyName = "Lion", OldProjectName = "AbpPro", @@ -76,9 +76,9 @@ public class AbpProCliCoreModule : AbpModule OldModuleName = "", }, - new AbpProTemplateOptions("pro-nuget-gateways", "pro-nuget", "商业版本nuget版本") + new AbpProTemplateOptions("pro-nuget-gateways", "pro-nuget", "商业版本nuget网关版本") { - ExcludeFiles = ".github,LICENSE,Readme.md,aspnet-core,.idea,MyCompanyName.MyProjectName.sln,MyCompanyName.MyProjectName.sln.DotSettings.user", + ExcludeFiles = ".github,LICENSE,Readme.md,aspnet-core,.idea,MyCompanyName.MyProjectName.sln,MyCompanyName.MyProjectName.sln.DotSettings.user,Lion.AbpPro.Cli.sln", ReplaceSuffix = ".sln,.csproj,.cs,.cshtml,.json,.ci,.yml,.yaml,.nswag,.DotSettings,.env,Directory.Build.Lion.targets,.sln.DotSettings.user", OldCompanyName = "MyCompanyName", OldProjectName = "MyProjectName", diff --git a/aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Commands/CreateCommand.cs b/aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Commands/CreateCommand.cs index dde9b127..68a49402 100644 --- a/aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Commands/CreateCommand.cs +++ b/aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Commands/CreateCommand.cs @@ -104,7 +104,7 @@ public class CreateCommand : IConsoleCommand, ITransientDependency // 解压源码 var extractPath = _sourceCodeManager.ExtractProjectZip(localFilePath, _cliOptions.RepositoryId, version); - var contentPath = templateOptions.Name == "pro" ? extractPath : Path.Combine(extractPath, _cliOptions.RepositoryId, "templates", templateOptions.Name); + var contentPath = templateOptions.Name == "pro" ? extractPath : Path.Combine(extractPath, ".templates", templateOptions.Name); // 复制源码到输出目录 var destOutput = Path.Combine(CliPaths.Output, $"{companyName}-{projectName}-{version}"); diff --git a/aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Commands/NewCommand.cs b/aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Commands/NewCommand.cs index 748d0447..b1011b42 100644 --- a/aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Commands/NewCommand.cs +++ b/aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Commands/NewCommand.cs @@ -111,7 +111,7 @@ public class NewCommand : IConsoleCommand, ITransientDependency // 解压源码 var extractPath = _sourceCodeManager.ExtractProjectZip(localFilePath, _cliOptions.RepositoryId, version); - var contentPath = templateOptions.Name == "pro" ? Path.Combine(extractPath, _cliOptions.RepositoryId) : Path.Combine(extractPath, _cliOptions.RepositoryId, "templates", templateOptions.Name); + var contentPath = templateOptions.Name == "pro" ? extractPath : Path.Combine(extractPath, "templates", templateOptions.Name); // 复制源码到输出目录 var destOutput = Path.Combine(CliPaths.Output, $"{companyName}-{projectName}-{version}"); @@ -119,6 +119,7 @@ public class NewCommand : IConsoleCommand, ITransientDependency { destOutput = Path.Combine(CliPaths.Output, $"{companyName}-{projectName}-{moduleName}-{version}"); } + DirectoryAndFileHelper.CopyFolder(contentPath, destOutput, templateOptions.ExcludeFiles); ReplaceHelper.ReplaceTemplates(