diff options
author | RaindropsSys <raindrops@equestria.dev> | 2024-05-10 22:46:53 +0200 |
---|---|---|
committer | RaindropsSys <raindrops@equestria.dev> | 2024-05-10 22:46:53 +0200 |
commit | d56b6536f95ef928bcb0c690280887d976c60b9b (patch) | |
tree | 07fd18f26a574ee1849892d5de55b72156765f7e /launcher/src/main.rs | |
parent | 0ee8cd040aa7d1c89983454862c3939aea3c3bf1 (diff) | |
download | atomic-d56b6536f95ef928bcb0c690280887d976c60b9b.tar.gz atomic-d56b6536f95ef928bcb0c690280887d976c60b9b.tar.bz2 atomic-d56b6536f95ef928bcb0c690280887d976c60b9b.zip |
Crappy code fix 13/?
Diffstat (limited to 'launcher/src/main.rs')
-rw-r--r-- | launcher/src/main.rs | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/launcher/src/main.rs b/launcher/src/main.rs index bf11997..6fb8bc8 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -39,7 +39,7 @@ fn main() { work_dir.to_str().unwrap() ); - let app_data = locate_app(&work_dir); + let app_data = AppData::locate_app(&work_dir); let runtime_path = locate_runtime(); launch_app(runtime_path, app_data) } @@ -52,31 +52,6 @@ fn get_working_directory() -> PathBuf { .to_owned() } -fn locate_app(work_dir: &PathBuf) -> Option<AppData> { - let mut app_data: Option<AppData> = None; - - let mut app_path_folder = PathBuf::from(work_dir); - app_path_folder.push(constants::APP_FOLDER_PATH); - - let mut app_path_asar = PathBuf::from(work_dir); - app_path_asar.push(constants::APP_ASAR_PATH); - - if app_path_folder.exists() { - app_data = Some(AppData::Folder(app_path_folder)) - } else if app_path_asar.exists() { - app_data = Some(AppData::Asar(app_path_asar)) - } else { - 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() - ); - } - - app_data -} - fn locate_runtime() -> Option<PathBuf> { let runtime_search_paths = search_path::get_search_paths(); let runtime_search_paths_string = runtime_search_paths |