question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update PostAction with symbol parameters to cmd file arguments

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
donJoseLuiscommented, May 29, 2020

@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.

3reactions
skorubacommented, Aug 10, 2018

@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:

{
      "actionId": "3A7C4B45-1F5D-4A30-959A-51B88E82B5D2",
      "args": {
        "executable": "dotnet",
        "args": "run /seed --project src/(name).csproj"
      },
      "manualInstructions": [
        {
          "text": "Seeds the initial user database"
        }
      ],
      "continueOnError": false,
      "description ": "seeds the database"
    }

I need get the name of created csproj according user input. Any idea how to achieve that? Thx.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found