Skip to main content

Convert file separator in path variables

When Jenkins invoke shell scripts, it pass its environment variables to it. Include workspace path. But file separator is Java like ('/') instead of windows like ('\').

The solution is to convert the file separator using Dos String Manipulation.

...
set SLASH_FIXED_WORKSPACE=%WORKSPACE:/=\%
set TESTS_RUNTIME=%SLASH_FIXED_WORKSPACE%\TestsRuntime
...
..

Comments

I love articles like this one. You make some great points and I don't think I could have made them any better. Thanks for sharing !

Popular posts from this blog

Jenkins error: groovy.lang.MissingPropertyException

I tried to run groovy build step and got below error. This post will describe how I solved the problem.

Caught: groovy.lang.MissingPropertyException: No such property: hudson for class: script


Digital signature in pictures

I never remember what happens when digital signature is used. So here is my summary 'Digital signature for dummies'.