diff options
Diffstat (limited to 'launcher/src/main.rs')
-rw-r--r-- | launcher/src/main.rs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/launcher/src/main.rs b/launcher/src/main.rs index 6fb8bc8..4e61592 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -1,9 +1,8 @@ mod search_path; -mod constants; use std::path::PathBuf; use std::process; -use launcher::AppData; +use launcher::{AppData, AppDataError, constants}; fn show_system_info() { println!( @@ -70,7 +69,7 @@ fn locate_runtime() -> Option<PathBuf> { .next() } -fn launch_app(runtime_path: Option<PathBuf>, app_data: Option<AppData>) { +fn launch_app(runtime_path: Option<PathBuf>, app_data: Result<AppData, AppDataError>) { if let Some(path) = runtime_path { println!( "atomic-launcher: Found atomic-runtime at {}", @@ -80,8 +79,18 @@ fn launch_app(runtime_path: Option<PathBuf>, app_data: Option<AppData>) { cmd.env("ATOMIC_LAUNCHER_VERSION", constants::VERSION); println!("atomic-launcher: Executing: {:?}", cmd); - if let Some(app_data) = app_data { - cmd.arg(app_data.get_path()); + match app_data { + Ok(app_data) => { + cmd.arg(app_data.get_path()); + } + Err(AppDataError::NotFound(app_path_folder, app_path_asar)) => { + println!( + "atomic-launcher: Warning: Could not find Electron-compatible app.\ + Looked in {} and {}. The default atomic-runtime application will be opened instead.", + app_path_folder.to_str().unwrap(), + app_path_asar.to_str().unwrap() + ); + } } if let Ok(status) = cmd.status() { |