chore: Remove expect-exit as a dependency and add bacon config

This commit is contained in:
Gerald Pinder 2024-10-11 16:32:16 -04:00
parent 3a4782408d
commit ceefc7175a
5 changed files with 472 additions and 349 deletions

View file

@ -13,7 +13,6 @@ path = "process.rs"
[dependencies]
anyhow = "1"
blue-build-utils = { version = "=0.8.20", path = "../utils" }
expect-exit = "0.5"
indicatif-log-bridge = "0.2"
lenient_semver = "0.4"
log4rs = { version = "1", features = ["background_rotation"] }

View file

@ -1,6 +1,7 @@
use std::{
fs,
path::PathBuf,
process::ExitCode,
sync::{atomic::AtomicBool, Arc, Mutex},
thread,
};
@ -91,10 +92,10 @@ where
let app = thread::spawn(app_exec);
if matches!(app.join(), Ok(())) {
expect_exit::exit_unwind(0);
exit_unwind(ExitCode::SUCCESS);
} else {
error!("App thread panic!");
expect_exit::exit_unwind(1);
exit_unwind(ExitCode::FAILURE);
}
});
@ -131,7 +132,7 @@ where
});
drop(cid_list);
expect_exit::exit_unwind(1);
exit_unwind(ExitCode::FAILURE);
}
SIGTSTP => {
if has_terminal {
@ -153,6 +154,10 @@ where
}
}
fn exit_unwind(code: ExitCode) {
std::panic::resume_unwind(Box::new(code));
}
fn send_signal_processes(sig: i32) {
let pid_list = PID_LIST.clone();
let pid_list = pid_list.lock().expect("Should lock mutex");