refactor: move logic away from tauri commands

This commit is contained in:
2025-02-12 23:10:18 +01:00
parent 047b2e9f4a
commit fdf3679fbe
12 changed files with 181 additions and 156 deletions

View File

@ -1,19 +1,19 @@
mod cfg;
mod types;
mod model;
mod cmd;
mod pkg_remote;
mod pkg_local;
mod util;
mod profile;
use tokio::{fs, try_join};
use tokio::sync::Mutex;
use types::{local, Package};
use model::Package;
use tauri::Manager;
use profile::Profile;
struct AppData {
profile: Option<local::Profile>,
profile: Option<Profile>,
mods_local: Vec<Package>,
mods_store: Vec<Package>,
}
@ -35,7 +35,7 @@ pub async fn run(args: Vec<String>) {
let app_data = AppData {
profile: pkg_local::load_config(),
mods_local: pkg_local::walk_packages(true).await,
mods_local: pkg_local::walk_packages(true).await.expect("Unable to scan local packages"),
mods_store: [].to_vec(),
};