mirror of
https://github.com/tauri-apps/tauri-plugin-process.git
synced 2026-01-31 00:55:17 +01:00
fix(updater): Use escaped installer path to start the nsis updater (#727)
Port of v1 change: https://github.com/tauri-apps/tauri/pull/7956 Committed via a GitHub action: https://github.com/tauri-apps/plugins-workspace/actions/runs/6877612128 Co-authored-by: amrbashir <amrbashir@users.noreply.github.com>
This commit is contained in:
45
dist-js/index.cjs
Normal file
45
dist-js/index.cjs
Normal file
@@ -0,0 +1,45 @@
|
||||
'use strict';
|
||||
|
||||
var primitives = require('@tauri-apps/api/primitives');
|
||||
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
/**
|
||||
* Perform operations on the current process.
|
||||
* @module
|
||||
*/
|
||||
/**
|
||||
* Exits immediately with the given `exitCode`.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { exit } from '@tauri-apps/plugin-process';
|
||||
* await exit(1);
|
||||
* ```
|
||||
*
|
||||
* @param code The exit code to use.
|
||||
* @returns A promise indicating the success or failure of the operation.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async function exit(code = 0) {
|
||||
return primitives.invoke("plugin:process|exit", { code });
|
||||
}
|
||||
/**
|
||||
* Exits the current instance of the app then relaunches it.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { relaunch } from '@tauri-apps/plugin-process';
|
||||
* await relaunch();
|
||||
* ```
|
||||
*
|
||||
* @returns A promise indicating the success or failure of the operation.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async function relaunch() {
|
||||
return primitives.invoke("plugin:process|restart");
|
||||
}
|
||||
|
||||
exports.exit = exit;
|
||||
exports.relaunch = relaunch;
|
||||
@@ -40,4 +40,3 @@ async function relaunch() {
|
||||
}
|
||||
|
||||
export { exit, relaunch };
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
82
dist-js/index.min.js
vendored
82
dist-js/index.min.js
vendored
@@ -1,82 +0,0 @@
|
||||
/******************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
/* global Reflect, Promise, SuppressedError, Symbol */
|
||||
|
||||
|
||||
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
||||
var e = new Error(message);
|
||||
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
||||
};
|
||||
|
||||
/**
|
||||
* Sends a message to the backend.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { invoke } from '@tauri-apps/api/primitives';
|
||||
* await invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' });
|
||||
* ```
|
||||
*
|
||||
* @param cmd The command name.
|
||||
* @param args The optional arguments to pass to the command.
|
||||
* @param options The request options.
|
||||
* @return A promise resolving or rejecting to the backend response.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
async function invoke(cmd, args = {}, options) {
|
||||
return window.__TAURI_INTERNALS__.invoke(cmd, args, options);
|
||||
}
|
||||
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
/**
|
||||
* Perform operations on the current process.
|
||||
* @module
|
||||
*/
|
||||
/**
|
||||
* Exits immediately with the given `exitCode`.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { exit } from '@tauri-apps/plugin-process';
|
||||
* await exit(1);
|
||||
* ```
|
||||
*
|
||||
* @param code The exit code to use.
|
||||
* @returns A promise indicating the success or failure of the operation.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async function exit(code = 0) {
|
||||
return invoke("plugin:process|exit", { code });
|
||||
}
|
||||
/**
|
||||
* Exits the current instance of the app then relaunches it.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { relaunch } from '@tauri-apps/plugin-process';
|
||||
* await relaunch();
|
||||
* ```
|
||||
*
|
||||
* @returns A promise indicating the success or failure of the operation.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async function relaunch() {
|
||||
return invoke("plugin:process|restart");
|
||||
}
|
||||
|
||||
export { exit, relaunch };
|
||||
//# sourceMappingURL=index.min.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"index.mjs","sources":["../guest-js/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AACA;AACA;AAEA;;;AAGG;AAIH;;;;;;;;;;;;AAYG;AACH,eAAe,IAAI,CAAC,IAAI,GAAG,CAAC,EAAA;IAC1B,OAAO,MAAM,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;;;;;;AAWG;AACH,eAAe,QAAQ,GAAA;AACrB,IAAA,OAAO,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAC1C;;;;"}
|
||||
1
node_modules/tslib
generated
vendored
1
node_modules/tslib
generated
vendored
@@ -1 +0,0 @@
|
||||
../../../node_modules/.pnpm/tslib@2.6.0/node_modules/tslib
|
||||
11
package.json
11
package.json
@@ -6,26 +6,19 @@
|
||||
"Tauri Programme within The Commons Conservancy"
|
||||
],
|
||||
"type": "module",
|
||||
"browser": "dist-js/index.min.js",
|
||||
"module": "dist-js/index.mjs",
|
||||
"types": "dist-js/index.d.ts",
|
||||
"exports": {
|
||||
"import": "./dist-js/index.mjs",
|
||||
"types": "./dist-js/index.d.ts",
|
||||
"browser": "./dist-js/index.min.js"
|
||||
"import": "./dist-js/index.js",
|
||||
"require": "./dist-js/index.cjs"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c"
|
||||
},
|
||||
"files": [
|
||||
"dist-js",
|
||||
"!dist-js/**/*.map",
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"devDependencies": {
|
||||
"tslib": "2.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-alpha.11"
|
||||
}
|
||||
|
||||
7
rollup.config.js
Normal file
7
rollup.config.js
Normal file
@@ -0,0 +1,7 @@
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import { createConfig } from "../../shared/rollup.config.js";
|
||||
|
||||
export default createConfig();
|
||||
@@ -1,11 +0,0 @@
|
||||
import { readFileSync } from "fs";
|
||||
|
||||
import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
@@ -1 +1 @@
|
||||
if("__TAURI__"in window){var __TAURI_PROCESS__=function(n){"use strict";async function r(n,r={},e){return window.__TAURI_INTERNALS__.invoke(n,r,e)}return"function"==typeof SuppressedError&&SuppressedError,n.exit=async function(n=0){return r("plugin:process|exit",{code:n})},n.relaunch=async function(){return r("plugin:process|restart")},n}({});Object.defineProperty(window.__TAURI__,"process",{value:__TAURI_PROCESS__})}
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_PROCESS__=function(n){"use strict";async function r(n,r={},_){return window.__TAURI_INTERNALS__.invoke(n,r,_)}return"function"==typeof SuppressedError&&SuppressedError,n.exit=async function(n=0){return r("plugin:process|exit",{code:n})},n.relaunch=async function(){return r("plugin:process|restart")},n}({});Object.defineProperty(window.__TAURI__,"process",{value:__TAURI_PLUGIN_PROCESS__})}
|
||||
|
||||
Reference in New Issue
Block a user