fix(quark): fix automated installation and check exit code of executed external commands (#2119)(PR #2216)

This commit is contained in:
Jan S
2024-07-12 19:39:17 +02:00
committed by GitHub
parent 730db0d24f
commit 366225f9be
@@ -151,6 +151,7 @@ public class QuarkManager {
List<String> cmd = new ArrayList<>();
cmd.add(getCommand("pip3"));
cmd.add("install");
cmd.add("setuptools");
cmd.add("quark-engine");
cmd.add("--upgrade");
try {
@@ -213,6 +214,10 @@ public class QuarkManager {
} finally {
process.waitFor();
}
if (process.exitValue() != 0) {
throw new RuntimeException("Execution failed (exit code " + process.exitValue() + ") - command "
+ String.join(" ", cmd) + "\nPlease see command log output what was going wrong.");
}
}
private boolean checkCommand(String... cmd) {