Skip to content

Commit

Permalink
fix: Fix exit code in shutdown.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Oct 10, 2024
1 parent a0b3a61 commit 792817c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/app/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,17 @@ impl App {
self.phase = AppPhase::Shutdown;
self.handle_exit_code(session.shutdown().await?);

if self.exit_code.is_none() {
self.exit_code = Some(1);
if on_failure && self.exit_code.is_none() {
self.handle_exit_code(Some(1));
}

Ok(())
}

fn handle_exit_code(&mut self, code: Option<u8>) {
if let Some(code) = code {
trace!(code, "Setting exit code");

self.exit_code = Some(code);
}
}
Expand Down

0 comments on commit 792817c

Please sign in to comment.