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

Merge branch '307-alter-way-shell-commands-are-run' into 'develop'

Altering the way bash commands are run

See merge request !275
parents 9f5599f7 ce8c6ae4
No related branches found
No related tags found
1 merge request!275Altering the way bash commands are run
Pipeline #95506 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