Skip to content

Commit

Permalink
Merge remote-tracking branch 'Parent/v2' into Current
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Sep 12, 2024
2 parents 0e2abd4 + 9feabac commit 03a3984
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 23 deletions.
50 changes: 27 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
{
"authors": [
"Tauri Programme within The Commons Conservancy"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
},
"exports": {
"import": "./dist-js/index.js",
"require": "./dist-js/index.cjs",
"types": "./dist-js/index.d.ts"
},
"files": [
"dist-js",
"README.md",
"LICENSE"
],
"main": "./dist-js/index.cjs",
"module": "./dist-js/index.js",
"name": "@tauri-apps/plugin-process",
"scripts": {
"build": "rollup -c"
},
"types": "./dist-js/index.d.ts"
"name": "@tauri-apps/plugin-process",
"version": "2.0.0-rc.1",
"license": "MIT or APACHE-2.0",
"authors": [
"Tauri Programme within The Commons Conservancy"
],
"repository": "https://github.com/tauri-apps/plugins-workspace",
"type": "module",
"types": "./dist-js/index.d.ts",
"main": "./dist-js/index.cjs",
"module": "./dist-js/index.js",
"exports": {
"types": "./dist-js/index.d.ts",
"import": "./dist-js/index.js",
"require": "./dist-js/index.cjs"
},
"scripts": {
"build": "rollup -c"
},
"files": [
"dist-js",
"README.md",
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
}
}
15 changes: 15 additions & 0 deletions src/commands.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

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()
}
25 changes: 25 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

//! [![](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/process/banner.png)](https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/process)
//!
//! This plugin provides APIs to access the current process. To spawn child processes, see the [`shell`](https://github.com/tauri-apps/tauri-plugin-shell) plugin.
#![doc(
html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png",
html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png"
)]

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()
}

0 comments on commit 03a3984

Please sign in to comment.