madskristensen / NpmTaskRunner

Visual Studio extension
Other
88 stars 32 forks source link

Variables such as $(SolutionDir) don't seem to be replaced/applied #60

Closed mmacehardyman closed 6 years ago

mmacehardyman commented 6 years ago

Installed product versions

Description

My commands.json file uses variables such as $(SolutionDir) but they don't get applied. Looking at the code they should be applied:

https://github.com/madskristensen/CommandTaskRunner/blob/master/src/TaskRunner/TaskRunnerProvider.cs

Steps to recreate

  1. Add a new commands.json file or edit an existing one
  2. Use a variable, e.g. $(SolutionDir) in any of the fields (should be supported in Filename, Workingdirectory, Arguments and Name (again, looking at the code), for example the arguments field for passing a variable to a PowerShell script
  3. Run the task

Example commands.json:

{ "commands": { "Publish": { "fileName": "powershell.exe", "workingDirectory": ".", "arguments": "-ExecutionPolicy ByPass -File \"..\build\publish.ps1\" -SolutionDir \"$(SolutionDir)\"" } } }

Current behavior

Upon running the task, the used variable is not being replaced, but used 'as-is'.

Expected behavior

Looking at the code, it should support variable replacing so that it gets populated by the correct value.

mmacehardyman commented 6 years ago

My appologies, I submitted an issue for the wrong task runner. Closed this one and re-created the issue for the appropriate task runner (CommandTaskRunner).