Skip to content

Commit

Permalink
Add NotFound case to New3Command's instantiate flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Lorbetske authored and mlorbetske committed Jun 25, 2018
1 parent cbf576d commit 1627934
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/Microsoft.TemplateEngine.Cli/LocalizableStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -616,4 +616,7 @@ Run 'dotnet {1} --show-aliases' with no args to show all aliases.</value>
<data name="FileActionsWouldHaveBeenTaken" xml:space="preserve">
<value>File actions would have been taken:</value>
</data>
<data name="MissingTemplateContentDetected" xml:space="preserve">
<value>Unable to locate the specified template content, the template cache may be corrupted. Try running 'dotnet {0} --debug:reinit' to fix the issue.</value>
</data>
</root>
3 changes: 3 additions & 0 deletions src/Microsoft.TemplateEngine.Cli/New3Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ private async Task<CreationResultStatus> CreateTemplateAsync(ITemplateMatchInfo
break;
case CreationResultStatus.OperationNotSpecified:
break;
case CreationResultStatus.NotFound:
Reporter.Error.WriteLine(string.Format(LocalizableStrings.MissingTemplateContentDetected, CommandName).Bold().Red());
break;
case CreationResultStatus.InvalidParamValues:
TemplateUsageInformation usageInformation = TemplateUsageHelp.GetTemplateUsageInformation(template, EnvironmentSettings, _commandInput, _hostDataLoader, _templateCreator);
string invalidParamsError = InvalidParameterInfo.InvalidParameterListToString(usageInformation.InvalidParameters);
Expand Down

0 comments on commit 1627934

Please sign in to comment.