From ef8c4dafcf32320d6cb546a5d8c4a85e9c3f8607 Mon Sep 17 00:00:00 2001 From: Marcus Holl Date: Tue, 22 Jan 2019 12:45:16 +0100 Subject: [PATCH] one shArgs array for all sh calls. --- src/com/sap/piper/cm/ChangeManagement.groovy | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/com/sap/piper/cm/ChangeManagement.groovy b/src/com/sap/piper/cm/ChangeManagement.groovy index 58c2a425b..ffd7122c9 100644 --- a/src/com/sap/piper/cm/ChangeManagement.groovy +++ b/src/com/sap/piper/cm/ChangeManagement.groovy @@ -257,10 +257,17 @@ public class ChangeManagement implements Serializable { passwordVariable: 'password', usernameVariable: 'username')]) { + Map shArgs = [:] + + if(returnStdout) + shArgs.put('returnStdout', true) + else + shArgs.put('returnStatus', true) + if(type == BackendType.RFC) { - Map shArgs = [returnStatus: true, - 'script': command] + shArgs.script = command + args = args.plus([ "--env ABAP_DEVELOPMENT_SERVER=${endpoint}", "--env ABAP_DEVELOPMENT_USER=${script.username}", @@ -286,13 +293,7 @@ public class ChangeManagement implements Serializable { command, args, clientOpts) - Map shArgs = [:] - if(returnStdout) - shArgs.put('returnStdout', true) - else - shArgs.put('returnStatus', true) - - shArgs.put('script', cmScript) + shArgs.script = cmScript // user and password are masked by withCredentials script.echo """[INFO] Executing command line: "${cmScript}"."""