feat: etc

This commit is contained in:
2025-02-27 02:11:37 +01:00
parent 1586f81152
commit 947b384511
18 changed files with 263 additions and 146 deletions

View File

@ -20,16 +20,24 @@ pub async fn startline(app: AppHandle) -> Result<(), String> {
let appd = state.lock().await;
if let Some(p) = &appd.profile {
// TODO if p.needsUpdate
liner::line_up(p).await.expect("Line-up failed");
let hash = appd.sum_packages(p);
liner::line_up(p, hash).await
.map_err(|e| e.to_string())?;
start::start(p, app_copy)
.map_err(|e| { log::error!("Error launching: {}", e.to_string()); e.to_string() })
//Ok(())
.map_err(|e| e.to_string())
} else {
Err("No profile".to_owned())
}
}
#[tauri::command]
pub async fn kill() -> Result<(), String> {
start::pkill("amdaemon.exe").await;
// The start routine will kill the other process
Ok(())
}
#[tauri::command]
pub async fn install_package(state: State<'_, tokio::sync::Mutex<AppData>>, key: PkgKey) -> Result<InstallResult, String> {
log::debug!("invoke: install_package({})", key);