I am trying to save a git command output to a file before compiling, of an asp.net-core project.
In the "project.json" file I have the following, which should output the latest git tag to an output file (for versioning):
"scripts": {
"precompile": [
"git describe --tags > version.txt"
]
},
The git command runs fine in normal git bash and saves to a file. But when I compile the project in Visual Studio, there seems to be an issue with that greater than symbol. Should this be escaped somehow? The error shows: "fatal: Not a valid object name >"
Full error: "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): error : fatal: Not a valid object name >"
Any ideas?