Skip to content

Commit

Permalink
add exit-code retry and rename to exit_code in profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
willr3 committed Mar 23, 2024
1 parent 78d5485 commit 9fb86f8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/io/hyperfoil/tools/qdup/cmd/impl/Sh.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,13 @@ public void postRun(String output,Context context){
context.getShell().getHost().isShell())
{
String response = context.getShell().shSync("export __qdup_ec=$?; echo $__qdup_ec;");
// ensure the output does not contain characters from other processes
while(!response.matches("\\d+")){
response = context.getShell().shSync("echo $__qdup_ec;");
}
String pwd = context.getShell().shSync("pwd");
context.setCwd(pwd);
context.getCommandTimer().getJson().set("response",response);
context.getCommandTimer().getJson().set("exit_code",response);
context.getCommandTimer().getJson().set("cwd",pwd);
context.getShell().shSync("(exit $__qdup_ec);");
context.getShell().flushAndResetBuffer();
Expand Down

0 comments on commit 9fb86f8

Please sign in to comment.