CommandTaskRunner icon indicating copy to clipboard operation
CommandTaskRunner copied to clipboard

Feature Request: Currently opened file name as parameter

Open Wastus opened this issue 4 years ago • 4 comments

Installed product versions

  • Visual Studio: 2019 Professional
  • This extension: 1.3.62

Description

It would be nice to be able to pass the currently opened file path (relative or absolute would probably have both their use-cases) to the command. Currently I have a working batch-file which is able to do a single analysis of a source file and I'd like to integrate this into Visual Studio, but I'm unable to find a method to pass the currently opened file to a command.

I hoped this extension might help, but I haven't been able to get it to work in this way and looking at the source where the solution variables get substituted, it doesn't look like there is a variable available for it.

Wastus avatar Jan 05 '21 12:01 Wastus

I would find it very useful if all of the following were supported:

  • $(ProjectDir)
  • $(OutDir)
  • $(TargetName)
  • $(ConfigurationName)

Like the macros in a pre/post-build event:

image

This would allow me to get rid of the post-build event shown above, which is slowing down my build quite a bit.

yannduran avatar Jan 26 '21 11:01 yannduran

That is a different issue, and there is a merged pull request here: https://github.com/madskristensen/CommandTaskRunner/pull/13 which looks like it should be doing what you want.

Wastus avatar Jan 28 '21 10:01 Wastus

@Wastus sorry about that. I thought I was just adding more use cases to your own suggestion.

Thanks so much for the link to the Support MSBuild environment variables in commands #13 pull request, I had no idea that CTR was already capable of doing that!

yannduran avatar Jan 28 '21 11:01 yannduran

@yannduran no worries and happy to have helped.

Wastus avatar Jan 28 '21 12:01 Wastus