Skip to content

Commit

Permalink
fix(updater): Use escaped installer path to start the nsis updater (#…
Browse files Browse the repository at this point in the history
…727)

Port of v1 change: tauri-apps/tauri#7956

Committed via a GitHub action: https://github.com/tauri-apps/plugins-workspace/actions/runs/6877612128

Co-authored-by: amrbashir <[email protected]>
2 people authored and tauri-bot committed Nov 15, 2023

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent ae70b54 commit e457cee
Showing 8 changed files with 21 additions and 73 deletions.
56 changes: 9 additions & 47 deletions dist-js/index.min.js → dist-js/index.cjs
Original file line number Diff line number Diff line change
@@ -1,43 +1,6 @@
/******************************************************************************
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;
};
'use strict';

/**
* 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);
}
var primitives = require('@tauri-apps/api/primitives');

// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
@@ -68,7 +31,7 @@ class Database {
* ```
*/
static async load(path) {
const _path = await invoke("plugin:sql|load", {
const _path = await primitives.invoke("plugin:sql|load", {
db: path,
});
return new Database(_path);
@@ -125,10 +88,10 @@ class Database {
* ```
*/
async execute(query, bindValues) {
const [rowsAffected, lastInsertId] = await invoke("plugin:sql|execute", {
const [rowsAffected, lastInsertId] = await primitives.invoke("plugin:sql|execute", {
db: this.path,
query,
values: bindValues !== null && bindValues !== void 0 ? bindValues : [],
values: bindValues ?? [],
});
return {
lastInsertId,
@@ -154,10 +117,10 @@ class Database {
* ```
*/
async select(query, bindValues) {
const result = await invoke("plugin:sql|select", {
const result = await primitives.invoke("plugin:sql|select", {
db: this.path,
query,
values: bindValues !== null && bindValues !== void 0 ? bindValues : [],
values: bindValues ?? [],
});
return result;
}
@@ -173,12 +136,11 @@ class Database {
* @param db - Optionally state the name of a database if you are managing more than one. Otherwise, all database pools will be in scope.
*/
async close(db) {
const success = await invoke("plugin:sql|close", {
const success = await primitives.invoke("plugin:sql|close", {
db,
});
return success;
}
}

export { Database as default };
//# sourceMappingURL=index.min.js.map
module.exports = Database;
5 changes: 2 additions & 3 deletions dist-js/index.mjs → dist-js/index.js
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@ class Database {
const [rowsAffected, lastInsertId] = await invoke("plugin:sql|execute", {
db: this.path,
query,
values: bindValues !== null && bindValues !== void 0 ? bindValues : [],
values: bindValues ?? [],
});
return {
lastInsertId,
@@ -118,7 +118,7 @@ class Database {
const result = await invoke("plugin:sql|select", {
db: this.path,
query,
values: bindValues !== null && bindValues !== void 0 ? bindValues : [],
values: bindValues ?? [],
});
return result;
}
@@ -142,4 +142,3 @@ class Database {
}

export { Database as default };
//# sourceMappingURL=index.mjs.map
1 change: 0 additions & 1 deletion dist-js/index.min.js.map

This file was deleted.

1 change: 0 additions & 1 deletion dist-js/index.mjs.map

This file was deleted.

11 changes: 2 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -7,26 +7,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.2"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.11"
}
7 changes: 7 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -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();
11 changes: 0 additions & 11 deletions rollup.config.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion src/api-iife.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e457cee

Please sign in to comment.