Skip to content

Commit

Permalink
feat: 调整cli
Browse files Browse the repository at this point in the history
  • Loading branch information
WangJunZzz committed Feb 10, 2025
1 parent 9df6596 commit 7d6f78d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public async Task ExecuteAsync(CommandLineArgs commandLineArgs)
// 解压源码
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}");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public async Task ExecuteAsync(CommandLineArgs commandLineArgs)
// 解压源码
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}");

Expand Down Expand Up @@ -143,7 +143,6 @@ public void GetUsageInfo()
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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public string ExtractProjectZip(string zipPath, string repositoryId, string vers
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);

Expand Down

0 comments on commit 7d6f78d

Please sign in to comment.