Skip to content

Commit

Permalink
DCA11Y-1145: handle empty SHELL
Browse files Browse the repository at this point in the history
  • Loading branch information
flipatlas committed Oct 11, 2024
1 parent c9c4788 commit 7883b67
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ private String parseOutput(ByteArrayOutputStream stream) {
}

private String getCurrentShell() {


String shell = System.getenv("SHELL");
if (shell == null || shell.isEmpty()) {
logger.debug("SHELL is not available in environment variables. Trying to get it from child process.");
Expand All @@ -106,8 +108,7 @@ private String getCurrentShell() {
}

if (shell.isEmpty()) {
logger.debug("SHELL was not available in child process. Falling back to bin/sh");
shell = "/bin/sh";
throw new RuntimeException("SHELL was not available in child process. Falling back to bin/sh");
}
}

Expand Down

0 comments on commit 7883b67

Please sign in to comment.