mirror of
https://github.com/alterware/alterware-launcher.git
synced 2025-12-04 07:17:50 +00:00
log exit code and keep console open if it isn't 0
This commit is contained in:
@@ -470,13 +470,18 @@ async fn update(
|
|||||||
fn launch(file_path: &PathBuf, args: &str) {
|
fn launch(file_path: &PathBuf, args: &str) {
|
||||||
println!("\n\nJoin the AlterWare Discord server:\nhttps://discord.gg/2ETE8engZM\n\n");
|
println!("\n\nJoin the AlterWare Discord server:\nhttps://discord.gg/2ETE8engZM\n\n");
|
||||||
crate::println_info!("Launching {} {}", file_path.display(), args);
|
crate::println_info!("Launching {} {}", file_path.display(), args);
|
||||||
std::process::Command::new(file_path)
|
let exit_status = std::process::Command::new(file_path)
|
||||||
.args(args.trim().split(' '))
|
.args(args.trim().split(' '))
|
||||||
.current_dir(file_path.parent().unwrap())
|
.current_dir(file_path.parent().unwrap())
|
||||||
.spawn()
|
.spawn()
|
||||||
.expect("Failed to launch the game")
|
.expect("Failed to launch the game")
|
||||||
.wait()
|
.wait()
|
||||||
.expect("Failed to wait for the game process to finish");
|
.expect("Failed to wait for the game process to finish");
|
||||||
|
|
||||||
|
crate::println_error!("Game exited with status: {}", exit_status);
|
||||||
|
if !exit_status.success() {
|
||||||
|
misc::stdin();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
|
|||||||
Reference in New Issue
Block a user