mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-06 13:53:54 +02:00
feat(process): add plugin (#348)
This commit is contained in:
committed by
GitHub
parent
61e7d6ede5
commit
012d32e8ed
@@ -0,0 +1,11 @@
|
||||
use tauri::{AppHandle, Runtime};
|
||||
|
||||
#[tauri::command]
|
||||
pub fn exit<R: Runtime>(app: AppHandle<R>, code: i32) {
|
||||
app.exit(code)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn restart<R: Runtime>(app: AppHandle<R>) {
|
||||
app.restart()
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
use tauri::{
|
||||
plugin::{Builder, TauriPlugin},
|
||||
Runtime,
|
||||
};
|
||||
|
||||
mod commands;
|
||||
|
||||
pub fn init<R: Runtime>() -> TauriPlugin<R> {
|
||||
Builder::new("process")
|
||||
.invoke_handler(tauri::generate_handler![commands::exit, commands::restart])
|
||||
.build()
|
||||
}
|
||||
Reference in New Issue
Block a user