Skip to content
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

Add optional argument to dotnet new for adding .gitignore #6567

Open
isaacrlevin opened this issue Sep 19, 2022 · 9 comments
Open

Add optional argument to dotnet new for adding .gitignore #6567

isaacrlevin opened this issue Sep 19, 2022 · 9 comments
Labels
area: authoring Enhancements to the process of authoring, maintaining, and testing templates feature The issue defines new feature. Priority:2 Work that is important, but not critical for the release triaged The issue was evaluated by the triage team, placed on correct area, next action defined.
Milestone

Comments

@isaacrlevin
Copy link

Is your feature request related to a problem? Please describe.

Based off of Twitter thread for folks
https://twitter.com/isaacrlevin/status/1571908208675147776

Describe the solution you'd like

Adding a new argument to dotnet new that will allow adding a .gitignore to the output of the command. For instance

dotnet new web --add-git
@baronfel
Copy link
Member

First step would be to identify the templates that should have this option. Only some of them are in this repo. You can check the README on the dotnet/templating repo for a more up-to-date list of repos that own specific templates - I try to keep that up to date. Then, for each project template that should have this option, you'd add a new symbol to the template.json - note that there are different templates for each supported language, so you'd need to replicate that symbol.

Once you have a symbol defined, you'd add a postAction that has a condition that checks the symbol you defined earlier. I'd suggest looking at the run script postAction. Once you've made the changes, you can test by running dotnet new install path/to/template/folder to install the templates in that folder, invoke them, then uninstall with dotnet new uninstall path/to/template/folder.

@isaacrlevin
Copy link
Author

Got it, so there isn't a universal template that all the other templates inherit from? I was thinking at the same level the output argument, but you are saying it needs to be done at every template.

@baronfel
Copy link
Member

Correct - there's no inheritance here. Each template is an island.

@isaacrlevin
Copy link
Author

Got it. So this change will need to be in a few different repos than. I will take a look

@vlada-shubina
Copy link
Member

this is very much related to #3208 and #2771.

@isaacrlevin
Copy link
Author

@vlada-shubina is there work being done in this space? I would hate to start the process of updating every template if there is a new process coming at some point.

@vlada-shubina
Copy link
Member

No, unfortunately there is no definite timeline for those features at the moment.

@isaacrlevin
Copy link
Author

@baronfel when I get to a point to test the templates, I assume I need to build them into a a nupack file from the repo the templates are in (for instance the aspnet repo)? Than build a new version of dotnet new than run the command you provided? The docs aren't super clear

@vlada-shubina vlada-shubina added the triaged The issue was evaluated by the triage team, placed on correct area, next action defined. label Oct 3, 2022
@vlada-shubina vlada-shubina added this to the Backlog milestone Oct 3, 2022
@vlada-shubina
Copy link
Member

We decided it falls in scope of #3208 or #2771, but there is no definite timeline on that yet.

@vlada-shubina vlada-shubina transferred this issue from dotnet/sdk May 19, 2023
@vlada-shubina vlada-shubina added area: authoring Enhancements to the process of authoring, maintaining, and testing templates Priority:2 Work that is important, but not critical for the release feature The issue defines new feature. labels May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: authoring Enhancements to the process of authoring, maintaining, and testing templates feature The issue defines new feature. Priority:2 Work that is important, but not critical for the release triaged The issue was evaluated by the triage team, placed on correct area, next action defined.
Projects
None yet
Development

No branches or pull requests

3 participants