forked from tauri-apps/tauri-plugin-process
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'Parent/v2' into Current
- Loading branch information
Showing
3 changed files
with
67 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} |