From 7d6f78d0e33608c54d00be16177a281a18b32442 Mon Sep 17 00:00:00 2001 From: Hanpaopao <510423039@qq.com> Date: Mon, 10 Feb 2025 21:23:07 +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/Commands/CreateCommand.cs | 2 +- .../Lion/AbpPro/Cli/Commands/NewCommand.cs | 3 +-- .../Lion/AbpPro/Cli/SourceCode/SourceCodeManager.cs | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) 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 8dbbcae1..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" ? 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}"); 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 5cc002bb..2f4ad77d 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}"); @@ -143,7 +143,6 @@ public class NewCommand : IConsoleCommand, ITransientDependency var sb = new StringBuilder(); sb.AppendLine(""); sb.AppendLine("Usage:"); - sb.AppendLine(" lion.abp new"); sb.AppendLine("lion.abp new -t 模板名称 -c 公司名称 -p 项目名称 -m 模块名称(创建模块才需要此参数)"); _logger.LogInformation(sb.ToString()); } diff --git a/aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/SourceCode/SourceCodeManager.cs b/aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/SourceCode/SourceCodeManager.cs index ec4de801..81ed7873 100644 --- a/aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/SourceCode/SourceCodeManager.cs +++ b/aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/SourceCode/SourceCodeManager.cs @@ -101,7 +101,7 @@ public class SourceCodeManager : ITransientDependency, ISourceCodeManager var targetPath = Path.Combine(Path.GetDirectoryName(zipPath), repositoryId + "-" + version); try { - if (Directory.Exists(targetPath)) return targetPath; + if (Directory.Exists(targetPath)) return Path.Combine(targetPath, repositoryId); System.IO.Compression.ZipFile.ExtractToDirectory(zipPath, targetPath, Encoding.UTF8, true);