From ee718ffb3a6a7f6464dc4c37a0a4e3deea751d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 27 Aug 2020 16:34:13 +0300 Subject: [PATCH] Resolved #5205: Add "--skip-cli-version-check" option to ABP CLI. --- docs/en/CLI.md | 6 ++++++ .../src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/en/CLI.md b/docs/en/CLI.md index 99808c3ba5..ff828b91a3 100644 --- a/docs/en/CLI.md +++ b/docs/en/CLI.md @@ -16,6 +16,12 @@ To update an existing installation: dotnet tool update -g Volo.Abp.Cli ```` +## Global Options + +While each command may have a set of options, there are some global options those can be used with any command; + +* `--skip-cli-version-check`: Skips to check the latest version of the ABP CLI. If you don't specify, it will check the latest version and shows a warning message if there is a newer version of the ABP CLI. + ## Commands Here, the list of all available commands before explaining their details: diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs index ef6eb79042..a984d79771 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs @@ -41,9 +41,13 @@ namespace Volo.Abp.Cli { Logger.LogInformation("ABP CLI (https://abp.io)"); - await CheckCliVersionAsync(); - var commandLineArgs = CommandLineArgumentParser.Parse(args); + + if (!commandLineArgs.Options.ContainsKey("skip-cli-version-check")) + { + await CheckCliVersionAsync(); + } + var commandType = CommandSelector.Select(commandLineArgs); using (var scope = ServiceScopeFactory.CreateScope()) @@ -72,7 +76,7 @@ namespace Volo.Abp.Cli var currentCliVersion = await GetCurrentCliVersion(assembly); var updateChannel = GetUpdateChannel(currentCliVersion); - Logger.LogInformation($"Version {currentCliVersion} ({updateChannel} channel)"); + Logger.LogInformation($"Version {currentCliVersion} ({updateChannel})"); try {