Browse Source

feat: 调整cli

pull/140/head 9.0.6
Hanpaopao 1 year ago
parent
commit
7d6f78d0e3
  1. 2
      aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Commands/CreateCommand.cs
  2. 3
      aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Commands/NewCommand.cs
  3. 2
      aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/SourceCode/SourceCodeManager.cs

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 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}");

3
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());
}

2
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);

Loading…
Cancel
Save