forked from akanyan/STARTLINER
feat: etc
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user