From 2af4542c420961898198a93837865407bf60e2f3 Mon Sep 17 00:00:00 2001 From: Tal Arian Date: Mon, 18 Sep 2023 18:04:11 +0300 Subject: [PATCH] Fix Tests --- .../build/extractor/executor/CommandExecutor.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/build-info-extractor/src/main/java/org/jfrog/build/extractor/executor/CommandExecutor.java b/build-info-extractor/src/main/java/org/jfrog/build/extractor/executor/CommandExecutor.java index 2b7d2218d..eeef2a1cb 100644 --- a/build-info-extractor/src/main/java/org/jfrog/build/extractor/executor/CommandExecutor.java +++ b/build-info-extractor/src/main/java/org/jfrog/build/extractor/executor/CommandExecutor.java @@ -182,10 +182,17 @@ private static Process runProcess(File execDir, List args, List if (credentials != null) { args.addAll(credentials); } + if (!SystemUtils.IS_OS_WINDOWS) { + String strArgs = join(" ", args); + args = new ArrayList() {{ + add("/bin/sh"); + add("-c"); + add(strArgs); + }}; + } logCommand(logger, args, credentials); ProcessBuilder processBuilder = new ProcessBuilder(args) - .directory(execDir) - .redirectErrorStream(true); + .directory(execDir); processBuilder.environment().putAll(env); return processBuilder.start(); }