diff --git a/docs/en/CLI.md b/docs/en/CLI.md index f931d3688f..b4f2b704f2 100644 --- a/docs/en/CLI.md +++ b/docs/en/CLI.md @@ -123,6 +123,8 @@ abp update [options] #### Options * `--include-previews` or `-p`: Includes preview, beta and rc packages while checking the latest versions. +* `--npm`: Only updates NPM packages +* `--nuget`: Only updates NuGet packages ### help diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs index d4acd5e2cd..aa1c1501b5 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; @@ -43,8 +44,21 @@ namespace Volo.Abp.Cli.Commands public async Task ExecuteAsync(CommandLineArgs commandLineArgs) { - await UpdateNugetPackages(commandLineArgs); - UpdateNpmPackages(); + var updateNpm = commandLineArgs.Options.ContainsKey(Options.Packages.Npm); + var updateNuget = commandLineArgs.Options.ContainsKey(Options.Packages.NuGet); + + var both = (updateNuget && updateNpm) || (!updateNuget && !updateNpm); + + if (updateNpm || both) + { + await UpdateNugetPackages(commandLineArgs); + } + + if (updateNpm || both) + { + UpdateNpmPackages(); + } + } private void UpdateNpmPackages() @@ -99,6 +113,8 @@ namespace Volo.Abp.Cli.Commands sb.AppendLine(""); sb.AppendLine("Options:"); sb.AppendLine("-p|--include-previews (if supported by the template)"); + sb.AppendLine("--npm (Only updates NPM packages)"); + sb.AppendLine("--nuget (Only updates Nuget packages)"); sb.AppendLine(""); sb.AppendLine("Some examples:"); sb.AppendLine(""); @@ -123,6 +139,12 @@ namespace Volo.Abp.Cli.Commands public const string Short = "p"; public const string Long = "include-previews"; } + + public static class Packages + { + public const string Npm = "npm"; + public const string NuGet = "nuget"; + } } } }