fix #1362 Call the asynchronous GetUsageInfo method correctly

pull/1363/head
maliming 6 years ago
parent 63bc860d75
commit 4537fd118d

@ -27,7 +27,7 @@ namespace Volo.Abp.Cli.Commands
{
if (commandLineArgs.Target == null)
{
throw new CliUsageException("Module name is missing!" + Environment.NewLine + Environment.NewLine + GetUsageInfo());
throw new CliUsageException("Module name is missing!" + Environment.NewLine + Environment.NewLine + await GetUsageInfo());
}
var skipDbMigrations = Convert.ToBoolean(

@ -27,7 +27,7 @@ namespace Volo.Abp.Cli.Commands
{
if (commandLineArgs.Target == null)
{
throw new CliUsageException("Package name is missing!" + Environment.NewLine + Environment.NewLine + GetUsageInfo());
throw new CliUsageException("Package name is missing!" + Environment.NewLine + Environment.NewLine + await GetUsageInfo());
}
await ProjectNugetPackageAdder.AddAsync(

@ -26,14 +26,14 @@ namespace Volo.Abp.Cli.Commands
{
if (commandLineArgs.Target.IsNullOrEmpty())
{
throw new CliUsageException("Username name is missing!" + Environment.NewLine + Environment.NewLine + GetUsageInfo());
throw new CliUsageException("Username name is missing!" + Environment.NewLine + Environment.NewLine + await GetUsageInfo());
}
Console.Write("Password: ");
var password = ConsoleHelper.ReadSecret();
if (password.IsNullOrWhiteSpace())
{
throw new CliUsageException("Password name is missing!" + Environment.NewLine + Environment.NewLine + GetUsageInfo());
throw new CliUsageException("Password name is missing!" + Environment.NewLine + Environment.NewLine + await GetUsageInfo());
}
await AuthService.LoginAsync(commandLineArgs.Target, password);

@ -29,7 +29,7 @@ namespace Volo.Abp.Cli.Commands
{
if (commandLineArgs.Target == null)
{
throw new CliUsageException("Project name is missing!" + Environment.NewLine + Environment.NewLine + GetUsageInfo());
throw new CliUsageException("Project name is missing!" + Environment.NewLine + Environment.NewLine + await GetUsageInfo());
}
Logger.LogInformation("Creating a new project...");

@ -8,6 +8,7 @@ using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.Cli.Args;
using Volo.Abp.Cli.ProjectModification;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Threading;
namespace Volo.Abp.Cli.Commands
{
@ -67,7 +68,7 @@ namespace Volo.Abp.Cli.Commands
}
throw new CliUsageException("No solution or project found in this directory." + Environment.NewLine +
Environment.NewLine + GetUsageInfo());
Environment.NewLine + AsyncHelper.RunSync(GetUsageInfo));
}
public Task<string> GetUsageInfo()

Loading…
Cancel
Save