From 13763309066777f8e3815dd9d194b3315c69b8c3 Mon Sep 17 00:00:00 2001 From: Dima Date: Fri, 13 Dec 2024 16:00:14 +0300 Subject: [PATCH] fix lambda --- .../jenkins/library/steps/CoverageCleanup.groovy | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ru/pulsar/jenkins/library/steps/CoverageCleanup.groovy b/src/ru/pulsar/jenkins/library/steps/CoverageCleanup.groovy index 7f3ee668..7d7c9332 100644 --- a/src/ru/pulsar/jenkins/library/steps/CoverageCleanup.groovy +++ b/src/ru/pulsar/jenkins/library/steps/CoverageCleanup.groovy @@ -10,8 +10,6 @@ class CoverageCleanup implements Serializable { private final JobConfiguration config private final String stageName - private String encoding = 'UTF-8' - CoverageCleanup(JobConfiguration config, String stageName = "") { this.config = config this.stageName = stageName @@ -39,9 +37,14 @@ class CoverageCleanup implements Serializable { if (steps.isUnix()) { command = "kill $pids" } else { - def pidsForCmd = pids.split(" ") - .each { it -> "/PID $it" } - .join(" ") + def pidsForCmd = '' + def pidsArray = pids.split(" ") + + pidsArray.each { + pidsForCmd += "/PID $it" + } + pidsForCmd = pidsForCmd.trim() + command = "taskkill $pidsForCmd /F" } steps.cmd(command, true, false)