Browse Source
Merge pull request #15128 from abpframework/issues/15114
Cli: show the current cli version
pull/15144/head
Alper Ebiçoğlu
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
6 deletions
-
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) |
|
|
|
{ |
|
|
|
Logger.LogInformation("ABP CLI (https://abp.io)"); |
|
|
|
var currentCliVersion = await GetCurrentCliVersionInternalAsync(typeof(CliService).Assembly); |
|
|
|
Logger.LogInformation($"ABP CLI {currentCliVersion}"); |
|
|
|
|
|
|
|
var commandLineArgs = CommandLineArgumentParser.Parse(args); |
|
|
|
|
|
|
|
#if !DEBUG
|
|
|
|
if (!commandLineArgs.Options.ContainsKey("skip-cli-version-check")) |
|
|
|
{ |
|
|
|
await CheckCliVersionAsync(); |
|
|
|
await CheckCliVersionAsync(currentCliVersion); |
|
|
|
} |
|
|
|
#endif
|
|
|
|
try |
|
|
|
@ -168,7 +169,7 @@ public class CliService : ITransientDependency |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private async Task CheckCliVersionAsync() |
|
|
|
private async Task CheckCliVersionAsync(SemanticVersion currentCliVersion) |
|
|
|
{ |
|
|
|
if (!await IsLatestVersionCheckExpiredAsync()) |
|
|
|
{ |
|
|
|
@ -177,11 +178,8 @@ public class CliService : ITransientDependency |
|
|
|
|
|
|
|
var assembly = typeof(CliService).Assembly; |
|
|
|
var toolPath = GetToolPath(assembly); |
|
|
|
var currentCliVersion = await GetCurrentCliVersionInternalAsync(assembly); |
|
|
|
var updateChannel = GetUpdateChannel(currentCliVersion); |
|
|
|
|
|
|
|
Logger.LogInformation($"Version {currentCliVersion} ({updateChannel})"); |
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
var latestVersion = await GetLatestVersion(updateChannel); |
|
|
|
|