Files
pages/apps/app/src/api/process.rs
Geometrically 49a20a303a Migrate to SQLite for Internal Launcher Data (#1300)
* initial migration

* barebones profiles

* Finish profiles

* Add back file watcher

* UI support progress

* Finish most of cache

* Fix options page

* Fix forge, finish modrinth auth

* Accounts, process cache

* Run SQLX prepare

* Finish

* Run lint + actions

* Fix version to be compat with windows

* fix lint

* actually fix lint

* actually fix lint again
2024-07-24 18:03:19 +00:00

34 lines
851 B
Rust

use crate::api::Result;
use theseus::prelude::*;
pub fn init<R: tauri::Runtime>() -> tauri::plugin::TauriPlugin<R> {
tauri::plugin::Builder::new("process")
.invoke_handler(tauri::generate_handler![
process_get_all,
process_get_by_profile_path,
process_kill,
process_wait_for,
])
.build()
}
#[tauri::command]
pub async fn process_get_all() -> Result<Vec<Process>> {
Ok(process::get_all().await?)
}
#[tauri::command]
pub async fn process_get_by_profile_path(path: &str) -> Result<Vec<Process>> {
Ok(process::get_by_profile_path(path).await?)
}
#[tauri::command]
pub async fn process_kill(pid: i32) -> Result<()> {
Ok(process::kill(pid).await?)
}
#[tauri::command]
pub async fn process_wait_for(pid: i32) -> Result<()> {
Ok(process::wait_for(pid).await?)
}