how can i use system.teamcity.build.workingDir in content replacer build feature

hello, 

this is probably a silly question : i want to use replace content with the value of system.teamcity.build.workingDir.

in the documentation, it is said that any \ should be \\ but the value of system.teamcity.build.workingDir is C:\BuildAgent\workabbf37441225486d and when using it in content replacer it replace C:BuildAgentworkabbf37441225486d.

 

how can i use system.teamcity.build.workingDir in content file replacer ?

0
2 comments
Hi Sebastien,

You can use fixed strings (disable the Regex mode); this way, the \ and $ characters will have no special meaning and be replaced as is. However, it will also mean that you won't be able to use regex for a search pattern, only the exact match. If it doesn't work for your scenario, you can use the REGEX_MIXED mode. In this mode, the search pattern is interpreted as a regular expression, but the replacement text will be quoted (the \ and $ characters have no special meaning), but this mode is not available from the UI, only when you use versioned settings and store the project settings in VCS either in XML or Kotlin format. Please see the example in the documentation: https://www.jetbrains.com/help/teamcity/2024.03/file-content-replacer.html#File+Content+Replacer+Settings (Regex mode setting description).

Best regards,
Anton
0

big thank you 

sebastien

0

Please sign in to leave a comment.