Update PostAction with symbol parameters to cmd file arguments
See original GitHub issueI need to pass symbols parameters to args when executing setup.cmd file using postActions property as below .template.config file.
Here, i am passing two symbols of type string jsonFileNamePath and myfilename as arguments to setup.cmd.
{
"$schema": "http://json.schemastore.org/template",
"identity": "SampleTemplate",
"groupIdentity": "SampleTemplate",
"author": "Abhishek",
"classifications": ["api", "apiswagger"],
"name": "Sample Template",
"shortName": "SampleTemplate",
"tags": {
"language": "C#"
},
"sourceName": "SampleTemplate",
"primaryOutputs": [
{
"path": "SampleTemplate.csproj"
}
],
"guids": [
"98048C9C-BF28-46BA-A98E-63767EE5E3A8",
"FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF"
],
"symbols": {
"skipRestore": {
"type": "parameter",
"datatype": "bool",
"description": "Skips the execution of 'dotnet restore' on project creation.",
"defaultValue": "false"
},
"jsonFileNamePath": {
"type": "parameter",
"datatype": "string",
"description": "Path of the json file ",
"defaultValue": "myjson.json",
"isRequired" : "true"
},
"myfilename": {
"type": "parameter",
"datatype": "string",
"description": "Name of the json file ",
"defaultValue": "myjson",
"isRequired" : "true"
}
},
"postActions": [
{
"condition": "(!skipRestore)",
"description": "Restore NuGet packages required by this project.",
"manualInstructions": [
{ "text": "Run 'dotnet restore'" }
],
"actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025",
"continueOnError": true
},
{
"actionId": "3A7C4B45-1F5D-4A30-959A-51B88E82B5D2",
"args": {
"executable": "setup.cmd",
"args": "jsonFileNamePath myfilename"
},
"manualInstructions": [{
"text": "Run 'setup.cmd jsonFileNamePath myfilename'"
}],
"continueOnError": "false",
"description ": "setups the project by calling setup.cmd"
}
]
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:12 (8 by maintainers)
Top Results From Across the Web
Preserving "=" (equal) characters in batch file parameters
The "=" sign in the last parameter is expected by the application, I cannot change it. It works well when I call the...
Read more >Parameters / Arguments - Windows CMD
A parameter represents a value that the procedure expects you to pass when you call it. An argument represents the actual value that...
Read more >Passing '&' as text in parameter in batch file
I am trying to pass an argument to a BAT file thru VB Shell function. argument text value looks like this say Hello&123...
Read more >Customizing the build schemes for a project
A pop-up menu displays a list of schemes present in an Xcode project. To view and modify your project's current schemes, select Manage...
Read more >Beginning MySQL - Page 707 - Google Books Result
When you processed the result set, you used ResultSet methods to assign values to variables. This is the same method that you use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@wazzamatazz , thanks for the additional details. We are currently updating documents (working through that particular backlog). We can then move on to the “Template authoring” backlog, relevant to this issue. Please stay tuned.
@mlorbetske I think, it will be very useful - be able to pass the symbols in postAction. I’d like to solve a similiar use case.
I want to run command like this:
I need get the name of created csproj according user input. Any idea how to achieve that? Thx.