Skip to content

Commit

Permalink
Fix emitting the exit status in executeCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
Joannis committed Aug 30, 2024
1 parent e997eec commit 431fdd0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/Citadel/Exec/Client/ExecClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ final class TTYHandler: ChannelDuplexHandler {

func userInboundEventTriggered(context: ChannelHandlerContext, event: Any) {
switch event {
case is SSHChannelRequestEvent.ExitStatus:
()
case let status as SSHChannelRequestEvent.ExitStatus:
if status.exitStatus != 0 {
done.fail(SSHClient.CommandFailed(exitCode: status.exitStatus))
}
default:
context.fireUserInboundEventTriggered(event)
}
Expand Down

0 comments on commit 431fdd0

Please sign in to comment.