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

Question: How can I rename specific files in template.json? #32

Open
FlavioKrahl opened this issue May 2, 2018 · 2 comments
Open

Question: How can I rename specific files in template.json? #32

FlavioKrahl opened this issue May 2, 2018 · 2 comments

Comments

@FlavioKrahl
Copy link

FlavioKrahl commented May 2, 2018

@sayedihashimi
I saw your answer to a similar question at dotnet/templating#396. However I am not able to edit my template.json the way that is suggested in that issue. Is there something I am missing if I'm using the SideWaffle Creator or is that attribute for symbols simply not supported in this version? Thanks for the help in advance.
Greets Flavio

edit: To precise my question a bit, is it generally possible to add replacement parameters with custom values to a custom Wizard and have them replaced with user input? Because I can't seem to find a way to get this done with the Sidewaffle Creator. feelsBad

@sayedihashimi
Copy link
Member

I'm not really following your question completly, but I think the following may help you #17 (comment). If not can you describe what you're trying to do in more detail?

@FlavioKrahl
Copy link
Author

FlavioKrahl commented May 9, 2018

Okay I tried the approach mentioned in the issue you linked me to, but it doesn't exactly do what I'm trying to achieve. Let's say I have a Class "Module1.cs" and want to rename this file based on user input. In my custom Wizard I have following line of code in the RunStarted Method:

replacementDictionary.Add("passthrough:ModuleName", WizardForm.MyModuleName.Text)

In my template.json I added following symbol:

"symbols": {
    "ModuleName": {
      "type": "parameter",
      "datatype": "string",
      "replaces": "Module1",
      "fileRename:" :"Module1",
      "defaultValue": "MyModuleName"
    }
 }

However, my file "Module1.cs" is not renamed to "MyModuleName.cs" outside of the solution (in folder) or whatever else user input I give the custom wizard. It always keeps it's old name and the solution created with the template throws "file not found" after project creation, no matter what I do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants