123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384 |
- (function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory();
- else if(typeof define === 'function' && define.amd)
- define([], factory);
- else if(typeof exports === 'object')
- exports["tauri"] = factory();
- else
- root["tauri"] = factory();
- })(this, function() {
- return /******/ (() => { // webpackBootstrap
- /******/ var __webpack_modules__ = ({
- /***/ "../cli.rs/Cargo.toml":
- /*!****************************!*\
- !*** ../cli.rs/Cargo.toml ***!
- \****************************/
- /***/ ((module) => {
- module.exports = {
- "workspace": {},
- "package": {
- "name": "tauri-cli",
- "version": "1.0.0-beta.5",
- "authors": [
- "Tauri Programme within The Commons Conservancy"
- ],
- "edition": "2018",
- "categories": [
- "gui",
- "web-programming"
- ],
- "license": "Apache-2.0 OR MIT",
- "homepage": "https://tauri.studio",
- "repository": "https://github.com/tauri-apps/tauri",
- "description": "Command line interface for building Tauri apps",
- "include": [
- "src/",
- "/templates",
- "MergeModules/",
- "*.json",
- "*.rs"
- ]
- },
- "bin": [
- {
- "name": "cargo-tauri",
- "path": "src/main.rs"
- }
- ],
- "dependencies": {
- "clap": {
- "version": "3.0.0-beta.2",
- "features": [
- "yaml"
- ]
- },
- "anyhow": "1.0",
- "tauri-bundler": {
- "version": "1.0.0-beta.3",
- "path": "../bundler"
- },
- "colored": "2.0",
- "once_cell": "1.8",
- "serde": {
- "version": "1.0",
- "features": [
- "derive"
- ]
- },
- "serde_json": "1.0",
- "serde_with": "1.9",
- "notify": "4.0",
- "shared_child": "0.3",
- "toml_edit": "0.2",
- "json-patch": "0.2",
- "schemars": "0.8",
- "toml": "0.5",
- "valico": "3.6",
- "handlebars": "4.1",
- "include_dir": "0.6",
- "minisign": "0.6",
- "base64": "0.13.0",
- "ureq": "2.1",
- "os_info": "3.0",
- "semver": "1.0",
- "regex": "1.5",
- "lazy_static": "1",
- "libc": "0.2",
- "terminal_size": "0.1",
- "unicode-width": "0.1",
- "tempfile": "3",
- "zeroize": "1.3"
- },
- "target": {
- "cfg(windows)": {
- "dependencies": {
- "winapi": {
- "version": "0.3",
- "features": [
- "winbase",
- "winuser",
- "consoleapi",
- "processenv",
- "wincon"
- ]
- },
- "encode_unicode": "0.3"
- }
- },
- "cfg(target_os = \"linux\")": {
- "dependencies": {
- "heck": "0.3"
- }
- }
- },
- "build-dependencies": {
- "schemars": "0.8",
- "serde": {
- "version": "1.0",
- "features": [
- "derive"
- ]
- },
- "serde_json": "1.0",
- "serde_with": "1.9"
- }
- }
- /***/ }),
- /***/ "./src/helpers/download-binary.ts":
- /*!****************************************!*\
- !*** ./src/helpers/download-binary.ts ***!
- \****************************************/
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- "use strict";
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
- };
- var __generator = (this && this.__generator) || function (thisArg, body) {
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
- function verb(n) { return function (v) { return step([n, v]); }; }
- function step(op) {
- if (f) throw new TypeError("Generator is already executing.");
- while (_) try {
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
- if (y = 0, t) op = [op[0] & 2, t.value];
- switch (op[0]) {
- case 0: case 1: t = op; break;
- case 4: _.label++; return { value: op[1], done: false };
- case 5: _.label++; y = op[1]; op = [0]; continue;
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
- default:
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
- if (t[2]) _.ops.pop();
- _.trys.pop(); continue;
- }
- op = body.call(thisArg, _);
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
- }
- };
- var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
- };
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.downloadRustup = exports.downloadCli = void 0;
- var stream_1 = __importDefault(__webpack_require__(/*! stream */ "stream"));
- var util_1 = __webpack_require__(/*! util */ "util");
- var fs_1 = __importDefault(__webpack_require__(/*! fs */ "fs"));
- var got_1 = __importDefault(__webpack_require__(/*! got */ "got"));
- var path_1 = __importDefault(__webpack_require__(/*! path */ "path"));
- var pipeline = util_1.promisify(stream_1.default.pipeline);
- // Webpack reads the file at build-time, so this becomes a static var
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-member-access
- var tauriCliManifest = __webpack_require__(/*! ../../../cli.rs/Cargo.toml */ "../cli.rs/Cargo.toml");
- var downloads = {};
- function downloadBinaryRelease(tag, asset, outPath) {
- return __awaiter(this, void 0, void 0, function () {
- var url, removeDownloadedCliIfNeeded;
- return __generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- url = "https://github.com/tauri-apps/binary-releases/releases/download/" + tag + "/" + asset;
- removeDownloadedCliIfNeeded = function () {
- try {
- if (!(url in downloads)) {
- // eslint-disable-next-line security/detect-non-literal-fs-filename
- fs_1.default.unlinkSync(outPath);
- }
- }
- finally {
- process.exit();
- }
- };
- // on exit, we remove the `tauri-cli` file if the download didn't complete
- process.on('exit', removeDownloadedCliIfNeeded);
- process.on('SIGINT', removeDownloadedCliIfNeeded);
- process.on('SIGTERM', removeDownloadedCliIfNeeded);
- process.on('SIGHUP', removeDownloadedCliIfNeeded);
- process.on('SIGBREAK', removeDownloadedCliIfNeeded);
- // TODO: Check hash of download
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, security/detect-non-literal-fs-filename
- return [4 /*yield*/, pipeline(got_1.default.stream(url), fs_1.default.createWriteStream(outPath)).catch(function (e) {
- try {
- // eslint-disable-next-line security/detect-non-literal-fs-filename
- fs_1.default.unlinkSync(outPath);
- }
- catch (_a) { }
- throw e;
- })
- // eslint-disable-next-line security/detect-object-injection
- ];
- case 1:
- // TODO: Check hash of download
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, security/detect-non-literal-fs-filename
- _a.sent();
- // eslint-disable-next-line security/detect-object-injection
- downloads[url] = true;
- // eslint-disable-next-line security/detect-non-literal-fs-filename
- fs_1.default.chmodSync(outPath, 448);
- console.log('Download Complete');
- return [2 /*return*/];
- }
- });
- });
- }
- function downloadCli() {
- return __awaiter(this, void 0, void 0, function () {
- var version, platform, extension, outPath;
- return __generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- version = tauriCliManifest.package.version;
- platform = process.platform;
- if (platform === 'win32') {
- platform = 'windows';
- }
- else if (platform === 'linux') {
- platform = 'linux';
- }
- else if (platform === 'darwin') {
- platform = 'macos';
- }
- else {
- throw Error('Unsupported platform');
- }
- extension = platform === 'windows' ? '.exe' : '';
- outPath = path_1.default.join(__dirname, "../../bin/tauri-cli" + extension);
- console.log('Downloading Rust CLI...');
- return [4 /*yield*/, downloadBinaryRelease("tauri-cli-v" + version, "tauri-cli_" + platform + extension, outPath)];
- case 1:
- _a.sent();
- return [2 /*return*/];
- }
- });
- });
- }
- exports.downloadCli = downloadCli;
- function downloadRustup() {
- return __awaiter(this, void 0, void 0, function () {
- var assetName;
- return __generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- assetName = process.platform === 'win32' ? 'rustup-init.exe' : 'rustup-init.sh';
- console.log('Downloading Rustup...');
- return [4 /*yield*/, downloadBinaryRelease('rustup', assetName, path_1.default.join(__dirname, "../../bin/" + assetName))];
- case 1: return [2 /*return*/, _a.sent()];
- }
- });
- });
- }
- exports.downloadRustup = downloadRustup;
- /***/ }),
- /***/ "fs":
- /*!*********************!*\
- !*** external "fs" ***!
- \*********************/
- /***/ ((module) => {
- "use strict";
- module.exports = require("fs");;
- /***/ }),
- /***/ "got":
- /*!**********************!*\
- !*** external "got" ***!
- \**********************/
- /***/ ((module) => {
- "use strict";
- module.exports = require("got");;
- /***/ }),
- /***/ "path":
- /*!***********************!*\
- !*** external "path" ***!
- \***********************/
- /***/ ((module) => {
- "use strict";
- module.exports = require("path");;
- /***/ }),
- /***/ "stream":
- /*!*************************!*\
- !*** external "stream" ***!
- \*************************/
- /***/ ((module) => {
- "use strict";
- module.exports = require("stream");;
- /***/ }),
- /***/ "util":
- /*!***********************!*\
- !*** external "util" ***!
- \***********************/
- /***/ ((module) => {
- "use strict";
- module.exports = require("util");;
- /***/ })
- /******/ });
- /************************************************************************/
- /******/ // The module cache
- /******/ var __webpack_module_cache__ = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/ // Check if module is in cache
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
- /******/ if (cachedModule !== undefined) {
- /******/ return cachedModule.exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = __webpack_module_cache__[moduleId] = {
- /******/ // no module.id needed
- /******/ // no module.loaded needed
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /************************************************************************/
- /******/
- /******/ // startup
- /******/ // Load entry module and return exports
- /******/ // This entry module is referenced by other modules so it can't be inlined
- /******/ var __webpack_exports__ = __webpack_require__("./src/helpers/download-binary.ts");
- /******/
- /******/ return __webpack_exports__;
- /******/ })()
- ;
- });
- //# sourceMappingURL=download-binary.js.map
|