-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to pick up certain template group or certain template to be run in case of ambiguity #4135
Comments
I like how explicit For instance, to instantiate editorconfig template from Boxed.Templates, one would need to type: The same happens with Maybe as an alternative, we can add a postfix to conflicting short names. For instance, if you have two templates with short name |
Another option would be to support the template identity as the main parameter to |
Template authors shouldn't be doing this. Instead of working around it, let's error when a user tries to install a template with a conflict on Here is a JSON file (renamed as .txt to support GH) with all the templates that I could find. Will look for dupes later. |
I ran my tool to identify templates that re-use the I only found 4 IDs that are actually being used in different templates.
My report did include the following as well, but that is due to this bug #4140. Those are listed below.
|
There are three sides to this:
|
For the |
At the moment 2 cases for ambiguity may happen during template instantiation:
Those cases may be solved by uninstalling one of the packages in template groups are coming from different packages, however if they are coming from single one the situation cannot be resolved.
Suggesting the following options to resolve these conflicts:
--group
allows to specify group identity to run--identity
allows to specify template identity to runThe error cases should be modified as following:
(ambiguous group)
Unable to resolve the template, these templates matched your input:
To run specific template, specify its group using --group option.
dotnet new short --group Group.Identity1.
(ambiguous template)
Unable to resolve the template, these templates matched your input:
This may happen due to authoring error or ambiguous parameter set
.To run specific template, specify the identity using --identity option.
dotnet new short --identity Templ.Identity1
The text was updated successfully, but these errors were encountered: