Browse Source

feat: 调整cli

main-cli
Hanpaopao 1 year ago
parent
commit
33b22306c0
  1. 6
      aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/AbpProCliCoreModule.cs
  2. 2
      aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Commands/CreateCommand.cs
  3. 4
      aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Utils/DirectoryAndFileHelper.cs

6
aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/AbpProCliCoreModule.cs

@ -58,7 +58,7 @@ public class AbpProCliCoreModule : AbpModule
options.RepositoryId = "abp"; options.RepositoryId = "abp";
options.Templates = new List<AbpProTemplateOptions>() options.Templates = new List<AbpProTemplateOptions>()
{ {
new AbpProTemplateOptions("source", "source", "商业版本源码版本") new AbpProTemplateOptions("abp", "abp", "商业版本源码版本")
{ {
ExcludeFiles = ".github,LICENSE,Readme.md", ExcludeFiles = ".github,LICENSE,Readme.md",
ReplaceSuffix = ".sln,.csproj,.cs,.cshtml,.json,.ci,.yml,.yaml,.nswag,.DotSettings,.env,Directory.Build.Lion.targets", ReplaceSuffix = ".sln,.csproj,.cs,.cshtml,.json,.ci,.yml,.yaml,.nswag,.DotSettings,.env,Directory.Build.Lion.targets",
@ -67,7 +67,7 @@ public class AbpProCliCoreModule : AbpModule
OldModuleName = "", OldModuleName = "",
}, },
new AbpProTemplateOptions("nuget", "nuget", "商业版本nuget版本") new AbpProTemplateOptions("abp-nuget", "abp-nuget", "商业版本nuget版本")
{ {
ExcludeFiles = ".github,LICENSE,Readme.md,aspnet-core,.idea,gateways,MyCompanyName.MyProjectName.Gateways.sln,MyCompanyName.MyProjectName.Gateways.sln.DotSettings.user", ExcludeFiles = ".github,LICENSE,Readme.md,aspnet-core,.idea,gateways,MyCompanyName.MyProjectName.Gateways.sln,MyCompanyName.MyProjectName.Gateways.sln.DotSettings.user",
ReplaceSuffix = ".sln,.csproj,.cs,.cshtml,.json,.ci,.yml,.yaml,.nswag,.DotSettings,.env,Directory.Build.Lion.targets,.sln.DotSettings.user", ReplaceSuffix = ".sln,.csproj,.cs,.cshtml,.json,.ci,.yml,.yaml,.nswag,.DotSettings,.env,Directory.Build.Lion.targets,.sln.DotSettings.user",
@ -76,7 +76,7 @@ public class AbpProCliCoreModule : AbpModule
OldModuleName = "", OldModuleName = "",
}, },
new AbpProTemplateOptions("nuget-gateways", "nuget", "商业版本nuget版本") new AbpProTemplateOptions("abp-nuget-gateways", "abp-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",
ReplaceSuffix = ".sln,.csproj,.cs,.cshtml,.json,.ci,.yml,.yaml,.nswag,.DotSettings,.env,Directory.Build.Lion.targets,.sln.DotSettings.user", ReplaceSuffix = ".sln,.csproj,.cs,.cshtml,.json,.ci,.yml,.yaml,.nswag,.DotSettings,.env,Directory.Build.Lion.targets,.sln.DotSettings.user",

2
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 extractPath = _sourceCodeManager.ExtractProjectZip(localFilePath, _cliOptions.RepositoryId, version);
var contentPath = templateOptions.Name == "source" ? Path.Combine(extractPath, _cliOptions.RepositoryId) : Path.Combine(extractPath, _cliOptions.RepositoryId, "templates", templateOptions.Name); var contentPath = templateOptions.Name == _cliOptions.RepositoryId ? Path.Combine(extractPath, _cliOptions.RepositoryId) : Path.Combine(extractPath, _cliOptions.RepositoryId, "templates", templateOptions.Name);
// 复制源码到输出目录 // 复制源码到输出目录
var destOutput = Path.Combine(CliPaths.Output, $"{companyName}-{projectName}-{version}"); var destOutput = Path.Combine(CliPaths.Output, $"{companyName}-{projectName}-{version}");

4
aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Utils/DirectoryAndFileHelper.cs

@ -61,9 +61,9 @@ public static class DirectoryAndFileHelper
CopyFolder(folder, dest); //构建目标路径,递归复制文件 CopyFolder(folder, dest); //构建目标路径,递归复制文件
} }
} }
catch catch (Exception ex)
{ {
throw new UserFriendlyException("复制文件失败!"); throw new UserFriendlyException("复制文件失败!" + ex.Message + ex.StackTrace);
} }
} }

Loading…
Cancel
Save