I've created a build job that allows passing in a branch name as a build parameter and then runs the build to produce the output and copy the resulting artifact to another directory on the build server with the original artifact name suffixed with the branch name.
However when I pass in a branch name containing a slash in it (such as feature/someFeature
) this causes problems since the %env.Branch%
is substituted as is and makes the cp
command think it's a directory.
Is there some way to parse this branch name (or any env / system / build parameter) variable in TeamCity and do some processing on it like for e.g. run a tr '/' '-'
so that the slashes are replaced with hyphen?
TIA