Browse Source

closes volosoft/volo#926

pull/2824/head
Alper Ebicoglu 7 years ago
parent
commit
1106d9021a
  1. 20
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs
  2. 10
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Licensing/DeveloperApiKeyResult.cs

20
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs

@ -54,7 +54,7 @@ namespace Volo.Abp.Cli.Commands
private async Task InstallSuiteAsync()
{
var nugetIndexUrl = await GetNuGetIndexUrlAsync();
if (nugetIndexUrl == null)
{
return;
@ -108,13 +108,21 @@ namespace Volo.Abp.Cli.Commands
{
var apiKeyResult = await _apiKeyService.GetApiKeyOrNullAsync();
if (apiKeyResult == null || string.IsNullOrEmpty(apiKeyResult.ApiKey))
if (apiKeyResult == null)
{
Logger.LogWarning("You are not signed in! Use the CLI command \"abp login <username>\" to sign in, then try again.");
return null;
}
if (!string.IsNullOrWhiteSpace(apiKeyResult.ErrorMessage))
{
Logger.LogError("Couldn't retrieve your NuGet API key!");
Logger.LogWarning(File.Exists(CliPaths.AccessToken)
? "Make sure you have an active session and license on commercial.abp.io. To re-sign in you can use the CLI command \"abp login <username>\"."
: "You are not signed in to commercial.abp.io. Use the CLI command \"abp login <username>\" to sign in.");
Logger.LogWarning(apiKeyResult.ErrorMessage);
return null;
}
if (string.IsNullOrEmpty(apiKeyResult.ApiKey))
{
Logger.LogError("Couldn't retrieve your NuGet API key! You can re-sign in with the CLI command \"abp login <username>\".");
return null;
}

10
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Licensing/DeveloperApiKeyResult.cs

@ -10,5 +10,15 @@ namespace Volo.Abp.Cli.Licensing
public DateTime? LicenseEndTime { get; set; }
public bool CanDownloadSourceCode { get; set; }
public string LicenseCode { get; set; }
public string ErrorMessage { get; set; }
public LicenseErrorType? ErrorType { get; set; }
public enum LicenseErrorType
{
NotAuthenticated = 1,
NotMemberOfAnOrganization = 2,
NoActiveLicense = 3,
NotDeveloperOfTheOrganization = 4
}
}
}
Loading…
Cancel
Save