New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variable with backslash missing in output #4
Comments
Hi @wahabshah and thank you for your report. Could you upload us the debug logs of the task as mentionned here? We'll try to fix your issue as soon as possible! |
I'm away for a few days so I'll look into this later this week. However I think I know where this comes from. I think we should find a way to prevent vsts automatic evaluation of variables and then escape variables value before replacement. A few unit tests around values and escaping and a fix are needed. As usual PR are welcome :) |
Here is the log for the task with System.Debug set to true.
|
Hi @wahabshah, this is exactly the issue I diagnosed. The bad news is that in this case variable replacement is done by vsts itself and they do not provide a way to retrieve unexpanded input. So basically we can't know where a variable was located in the string and might need JSON escaping. The easiest way to fix this would be for you to escape your variable yourself i.e. We might consider adding a custom syntax like |
Thanks @sandorfr |
@wahabshah Considering there won't be any way to do this using native vsts variable suppport, I'll will implement the custom syntax soon. I'll keep you posted when this will be available. |
Trying to figure out the priority of this one as I really feel uncomfortable introducing a custom expand syntax. If someone is interested in this feature please leave a comment. |
I have variable $(CPath) with value C:\software
I am trying to patch the following XML's LogFile node
using Pach Content :
= /WnetConfiguration/Runtime/LogFile => "$(CPath)"
In the output XML, I am getting
As can be seen, output LogFile node is missing the backslash.
The text was updated successfully, but these errors were encountered: