Skip to content

Commit

Permalink
added robustness for duplicate separators
Browse files Browse the repository at this point in the history
duplicate separators previously caused issues when trying to relativize an absolute path which is needed for some tasks (e.g. links in the HTML reports, archiveArtifacts step, etc.).
  • Loading branch information
thabok committed Aug 15, 2019
1 parent 97c3f11 commit f1d6794
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/resources/dsl/btc.groovy
Expand Up @@ -766,7 +766,10 @@ def resolveConfig(body) {
* In all cases backslashes are replaced by slashes for compatibility reasons.
*/
def toAbsPath(path) {
// replace backslashes with slashes, they're easier to work with
def sPath = path.replace("\\", "/")
// replace multiple occurrences: e.g. C://file -> C:/file
sPath = path.replaceAll("(/)+", "/")
if (sPath.startsWith("/"))
sPath = sPath.substring(1, sPath.length())
if (sPath.contains(":"))
Expand Down

0 comments on commit f1d6794

Please sign in to comment.