Browse Source

Merge pull request #10092 from abpframework/Cli-ProjectNameValidator-Fix

Cli: Changed IllegalKeywords logic in ProjectNameValidator
pull/10100/head
ebicoglu 5 years ago
committed by GitHub
parent
commit
e7ca343165
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ProjectNameValidator.cs
  2. 3
      framework/test/Volo.Abp.Cli.Core.Tests/Volo/Abp/Cli/ProjectNameValidation_Tests.cs

2
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ProjectNameValidator.cs

@ -53,7 +53,7 @@ namespace Volo.Abp.Cli.Utils
{
foreach (var illegalKeyword in IllegalKeywords)
{
if (projectName.Contains(illegalKeyword))
if (projectName.Split(".").Contains(illegalKeyword))
{
throw new CliUsageException("Project name cannot contain the word \"" + illegalKeyword + "\". Specify a different name.");
}

3
framework/test/Volo.Abp.Cli.Core.Tests/Volo/Abp/Cli/ProjectNameValidation_Tests.cs

@ -58,6 +58,9 @@ namespace Volo.Abp.Cli
{
var args = new CommandLineArgs("new", illegalKeyword);
await _newCommand.ExecuteAsync(args).ShouldThrowAsync<CliUsageException>();
args = new CommandLineArgs("new", "Acme." + illegalKeyword);
await _newCommand.ExecuteAsync(args).ShouldThrowAsync<CliUsageException>();
}
}

Loading…
Cancel
Save