Browse Source

Merge pull request #3760 from abpframework/maliming/cli-update

Add SolutionName option to update command.
pull/3771/head
Yunus Emre Kalkan 7 years ago
committed by GitHub
parent
commit
f57c5fa14f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      docs/en/CLI.md
  2. 2
      docs/zh-Hans/CLI.md
  3. 15
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs

2
docs/en/CLI.md

@ -135,6 +135,8 @@ abp update [options]
* `--include-previews` or `-p`: Includes preview, beta and rc packages while checking the latest versions. * `--include-previews` or `-p`: Includes preview, beta and rc packages while checking the latest versions.
* `--npm`: Only updates NPM packages. * `--npm`: Only updates NPM packages.
* `--nuget`: Only updates NuGet packages. * `--nuget`: Only updates NuGet packages.
* `--solution-path` or `-sp`: Specify the solution path. Use the current directory by default
* `--solution-name` or `-sn`: Specify the solution name. Search `*.sln` files in the directory by default.
### switch-to-preview ### switch-to-preview

2
docs/zh-Hans/CLI.md

@ -135,6 +135,8 @@ abp update [options]
* `--include-previews` 或 `-p`: 将预览版, 测试版本 和 rc 包 同时更新到最新版本. * `--include-previews` 或 `-p`: 将预览版, 测试版本 和 rc 包 同时更新到最新版本.
* `--npm`: 仅更新NPM包 * `--npm`: 仅更新NPM包
* `--nuget`: 仅更新的NuGet包 * `--nuget`: 仅更新的NuGet包
* `--solution-path` 或 `-sp`: 指定解决方案路径/目录. 默认使用当前目录
* `--solution-name` 或 `-sn`: 指定解决方案名称. 默认在目录中搜索`*.sln`文件.
### 切换到每晚构建(预览)包 ### 切换到每晚构建(预览)包

15
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs

@ -57,7 +57,11 @@ namespace Volo.Abp.Cli.Commands
.Options .Options
.GetOrNull(Options.IncludePreviews.Short, Options.IncludePreviews.Long) != null; .GetOrNull(Options.IncludePreviews.Short, Options.IncludePreviews.Long) != null;
var solution = Directory.GetFiles(directory, "*.sln", SearchOption.AllDirectories).FirstOrDefault(); var solution = commandLineArgs.Options.GetOrNull(Options.SolutionName.Short, Options.SolutionName.Long);
if (solution.IsNullOrWhiteSpace())
{
solution = Directory.GetFiles(directory, "*.sln", SearchOption.AllDirectories).FirstOrDefault();
}
if (solution != null) if (solution != null)
{ {
@ -101,11 +105,14 @@ namespace Volo.Abp.Cli.Commands
sb.AppendLine("-p|--include-previews (if supported by the template)"); sb.AppendLine("-p|--include-previews (if supported by the template)");
sb.AppendLine("--npm (Only updates NPM packages)"); sb.AppendLine("--npm (Only updates NPM packages)");
sb.AppendLine("--nuget (Only updates Nuget packages)"); sb.AppendLine("--nuget (Only updates Nuget packages)");
sb.AppendLine("-sp|--solution-path (Specify the solution path)");
sb.AppendLine("-sn|--solution-name (Specify the solution name)");
sb.AppendLine(""); sb.AppendLine("");
sb.AppendLine("Some examples:"); sb.AppendLine("Some examples:");
sb.AppendLine(""); sb.AppendLine("");
sb.AppendLine(" abp update"); sb.AppendLine(" abp update");
sb.AppendLine(" abp update -p"); sb.AppendLine(" abp update -p");
sb.AppendLine(" abp update -sp \"D:\\projects\\\" -sn Acme.BookStore");
sb.AppendLine(""); sb.AppendLine("");
sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI"); sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI");
@ -125,6 +132,12 @@ namespace Volo.Abp.Cli.Commands
public const string Long = "solution-path"; public const string Long = "solution-path";
} }
public static class SolutionName
{
public const string Short = "sn";
public const string Long = "solution-name";
}
public static class IncludePreviews public static class IncludePreviews
{ {
public const string Short = "p"; public const string Short = "p";

Loading…
Cancel
Save