From 11878806eca7708360a82d526c10070651d14f16 Mon Sep 17 00:00:00 2001 From: Sergei Parshev Date: Tue, 18 Oct 2022 19:20:25 -0700 Subject: [PATCH] MPL-102 Fixed issue with path processing when running server on Win --- src/com/griddynamics/devops/mpl/Helper.groovy | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/griddynamics/devops/mpl/Helper.groovy b/src/com/griddynamics/devops/mpl/Helper.groovy index 3bf9244..8f66b18 100644 --- a/src/com/griddynamics/devops/mpl/Helper.groovy +++ b/src/com/griddynamics/devops/mpl/Helper.groovy @@ -181,7 +181,12 @@ abstract class Helper { */ @NonCPS static String pathToSimpleName(String path) { - return path.tokenize('./')[-3,-2].join('/') + def p = new File(path) + def fname = p.getName().toString() + if( p.getParentFile() ) { + return [p.getParentFile().getName(), fname.take(fname.lastIndexOf('.'))].join('/') + } + return fname.take(fname.lastIndexOf('.')) } /**