Skip to content

Commit

Permalink
Fix dotnet#454 by demanding that --name be specified if no non-empty …
Browse files Browse the repository at this point in the history
…name can be determined
  • Loading branch information
mlorbetske committed Mar 22, 2017
1 parent 001467b commit 4dbafd4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Microsoft.TemplateEngine.Edge/Template/TemplateCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public async Task<TemplateCreationResult> InstantiateAsync(ITemplateInfo templat
}

string realName = name ?? template.DefaultName ?? fallbackName;

if(string.IsNullOrEmpty(realName))
{
return new TemplateCreationResult("--name", CreationResultStatus.InvalidParamValues, template.Name);
}

// there should never be param errors here. If there are, the template is malformed, or the host gave an invalid value.
IParameterSet templateParams = SetupDefaultParamValuesFromTemplateAndHost(template, realName, out IList<string> defaultParamsWithInvalidValues);
if (defaultParamsWithInvalidValues.Any())
Expand Down

0 comments on commit 4dbafd4

Please sign in to comment.