maint: use UMU if found (#11)

This commit is contained in:
Spencer
2025-06-13 07:30:55 +01:00
committed by GitHub
parent d65a006bce
commit 806758088d

View File

@@ -549,9 +549,18 @@ fn launch(file_path: &PathBuf, args: &str) {
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 {} {args}", file_path.display()); crate::println_info!("Launching {} {args}", file_path.display());
let exit_status = if misc::is_program_in_path("wine") {
println!("Found wine, launching game using wine.\nIf you run into issues or want to launch a different way, run {} manually.", file_path.display()); let launcher = if misc::is_program_in_path("umu-run") {
std::process::Command::new("wine") Some("umu-run")
} else if misc::is_program_in_path("wine") {
Some("wine")
} else {
None
};
let exit_status = if let Some(launcher) = launcher {
println!("Found {launcher}, launching game using {launcher}.\nIf you run into issues or want to launch a different way, run {} manually.", file_path.display());
std::process::Command::new(launcher)
.args([file_path.to_str().unwrap(), args.trim()]) .args([file_path.to_str().unwrap(), args.trim()])
.current_dir(file_path.parent().unwrap()) .current_dir(file_path.parent().unwrap())
.spawn() .spawn()