-
Notifications
You must be signed in to change notification settings - Fork 381
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
Added template sample 17 to rename a file #8137
Added template sample 17 to rename a file #8137
Conversation
per closed issue dotnet#1238 a sample has been created to demonstrate renaming a file.
@dotnet-policy-service agree [company=""] |
@dotnet-policy-service agree |
dotnet-template-samples/content/17-rename-file/17-rename-file.sln
Outdated
Show resolved
Hide resolved
"$schema": "http://json.schemastore.org/template", | ||
"author": "Contoso", | ||
"classifications": [ "Console" ], | ||
"name": "Contoso Sample 17", | ||
"identity": "MyProject.17.Sample.CSharp", | ||
"groupIdentity":"MyProject.17.Sample", | ||
"shortName": "sample17", | ||
"tags": { | ||
"language": "C#", | ||
"type":"project" | ||
}, | ||
"symbols": { | ||
"renameFileParameter": { | ||
"type": "parameter", | ||
"displayName": "File name", | ||
"description": "Renames the default FileToRename.cs to the value provided.", | ||
"datatype": "text", | ||
"defaultValue": "FileToRename", | ||
"replaces": "FileToRename", // Optionally renames the text inside all files matching 'FileToRename' | ||
"fileRename": "FileToRename" // Finds files and folders including the text 'FileToRename' and replaces it with the value stored in the 'renameFileParameter' | ||
} | ||
}, | ||
"sourceName": "MyProject.Con", | ||
"preferNameDirectory":true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSON doesn't officially support comments. Please remove them. Also, here's some whitespace cleanup.
"$schema": "http://json.schemastore.org/template", | |
"author": "Contoso", | |
"classifications": [ "Console" ], | |
"name": "Contoso Sample 17", | |
"identity": "MyProject.17.Sample.CSharp", | |
"groupIdentity":"MyProject.17.Sample", | |
"shortName": "sample17", | |
"tags": { | |
"language": "C#", | |
"type":"project" | |
}, | |
"symbols": { | |
"renameFileParameter": { | |
"type": "parameter", | |
"displayName": "File name", | |
"description": "Renames the default FileToRename.cs to the value provided.", | |
"datatype": "text", | |
"defaultValue": "FileToRename", | |
"replaces": "FileToRename", // Optionally renames the text inside all files matching 'FileToRename' | |
"fileRename": "FileToRename" // Finds files and folders including the text 'FileToRename' and replaces it with the value stored in the 'renameFileParameter' | |
} | |
}, | |
"sourceName": "MyProject.Con", | |
"preferNameDirectory":true | |
"$schema": "http://json.schemastore.org/template", | |
"author": "Contoso", | |
"classifications": [ "Console" ], | |
"name": "Contoso Sample 17", | |
"identity": "MyProject.17.Sample.CSharp", | |
"groupIdentity": "MyProject.17.Sample", | |
"shortName": "sample17", | |
"tags": { | |
"language": "C#", | |
"type": "project" | |
}, | |
"symbols": { | |
"renameFileParameter": { | |
"type": "parameter", | |
"displayName": "File name", | |
"description": "Renames the default FileToRename.cs to the value provided.", | |
"datatype": "text", | |
"defaultValue": "FileToRename", | |
"replaces": "FileToRename", | |
"fileRename": "FileToRename" | |
} | |
}, | |
"sourceName": "MyProject.Con", | |
"preferNameDirectory": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, I just removed and formatted the template.json, comments we included based on the 01-basic-template example comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that's interesting. 🤔 I wouldn't use that as a good example. 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it was odd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was probably my fault 😁
Thanks for the contribution! |
per closed issue #1238 a sample has been created to demonstrate renaming a file.
Problem
No available examples renaming files or demonstrating the
fileRename
attribute .Solution
Created a new sample No.17 demonstrating the
fileRename
attribute.Checks: