Browse Source

Merge pull request #15128 from abpframework/issues/15114

Cli: show the current cli version
pull/15144/head
Alper Ebiçoğlu 4 years ago
committed by GitHub
parent
commit
fb56f60f89
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs

10
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs

@ -50,14 +50,15 @@ public class CliService : ITransientDependency
public async Task RunAsync(string[] args) public async Task RunAsync(string[] args)
{ {
Logger.LogInformation("ABP CLI (https://abp.io)"); var currentCliVersion = await GetCurrentCliVersionInternalAsync(typeof(CliService).Assembly);
Logger.LogInformation($"ABP CLI {currentCliVersion}");
var commandLineArgs = CommandLineArgumentParser.Parse(args); var commandLineArgs = CommandLineArgumentParser.Parse(args);
#if !DEBUG #if !DEBUG
if (!commandLineArgs.Options.ContainsKey("skip-cli-version-check")) if (!commandLineArgs.Options.ContainsKey("skip-cli-version-check"))
{ {
await CheckCliVersionAsync(); await CheckCliVersionAsync(currentCliVersion);
} }
#endif #endif
try try
@ -168,7 +169,7 @@ public class CliService : ITransientDependency
} }
} }
private async Task CheckCliVersionAsync() private async Task CheckCliVersionAsync(SemanticVersion currentCliVersion)
{ {
if (!await IsLatestVersionCheckExpiredAsync()) if (!await IsLatestVersionCheckExpiredAsync())
{ {
@ -177,11 +178,8 @@ public class CliService : ITransientDependency
var assembly = typeof(CliService).Assembly; var assembly = typeof(CliService).Assembly;
var toolPath = GetToolPath(assembly); var toolPath = GetToolPath(assembly);
var currentCliVersion = await GetCurrentCliVersionInternalAsync(assembly);
var updateChannel = GetUpdateChannel(currentCliVersion); var updateChannel = GetUpdateChannel(currentCliVersion);
Logger.LogInformation($"Version {currentCliVersion} ({updateChannel})");
try try
{ {
var latestVersion = await GetLatestVersion(updateChannel); var latestVersion = await GetLatestVersion(updateChannel);

Loading…
Cancel
Save