Skip to content
Snippets Groups Projects
Commit ce8c6ae4 authored by Lukasz Lopatowski's avatar Lukasz Lopatowski
Browse files

Altering the way bash commands are run

parent 9f5599f7
No related branches found
No related tags found
1 merge request!275Altering the way bash commands are run
Pipeline #95503 passed
......@@ -25,7 +25,7 @@ public class DefaultCommandExecutor implements CommandExecutor {
private String executeInternal(Command command) throws CommandExecutionException {
try {
log.info("Executing: {}", command.asString());
Process process = new ProcessBuilder(command.asString().split(" ")).start();
Process process = new ProcessBuilder(new String[]{"bash", "-c", command.asString()}).start();
final String errorOutput = new String(process.getErrorStream().readAllBytes(), StandardCharsets.UTF_8);
if (Strings.isNotEmpty(errorOutput)) {
throw new CommandExecutionException("Error received during command execution (details: " + errorOutput + ")");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment