summaryrefslogtreecommitdiff
path: root/node_modules/electron-notarize/lib/helpers.js
diff options
context:
space:
mode:
authorLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 22:54:37 +0300
committerLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 22:54:37 +0300
commit703e03aba33f234712206769f57717ba7d92d23d (patch)
tree0041f04ccb75bd5379c764e9fe42249fffe75fc3 /node_modules/electron-notarize/lib/helpers.js
parentab6e257e6e9d9a483d7e86f220d8b209a2cd7753 (diff)
downloadFlashRunner-703e03aba33f234712206769f57717ba7d92d23d.tar.gz
FlashRunner-703e03aba33f234712206769f57717ba7d92d23d.tar.zst
Added export_allowed file to make repository visible in cgit
Diffstat (limited to 'node_modules/electron-notarize/lib/helpers.js')
-rw-r--r--node_modules/electron-notarize/lib/helpers.js78
1 files changed, 78 insertions, 0 deletions
diff --git a/node_modules/electron-notarize/lib/helpers.js b/node_modules/electron-notarize/lib/helpers.js
new file mode 100644
index 0000000..27519ab
--- /dev/null
+++ b/node_modules/electron-notarize/lib/helpers.js
@@ -0,0 +1,78 @@
+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());
+ });
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const debug = require("debug");
+const fs = require("fs-extra");
+const os = require("os");
+const path = require("path");
+const d = debug('electron-notarize:helpers');
+function withTempDir(fn) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const dir = yield fs.mkdtemp(path.resolve(os.tmpdir(), 'electron-notarize-'));
+ d('doing work inside temp dir:', dir);
+ let result;
+ try {
+ result = yield fn(dir);
+ }
+ catch (err) {
+ d('work failed');
+ yield fs.remove(dir);
+ throw err;
+ }
+ d('work succeeded');
+ yield fs.remove(dir);
+ return result;
+ });
+}
+exports.withTempDir = withTempDir;
+class Secret {
+ constructor(value) {
+ this.value = value;
+ }
+ toString() {
+ return this.value;
+ }
+ inspect() {
+ return '******';
+ }
+}
+function makeSecret(s) {
+ return new Secret(s);
+}
+exports.makeSecret = makeSecret;
+function isSecret(s) {
+ return s instanceof Secret;
+}
+exports.isSecret = isSecret;
+function parseNotarizationInfo(info) {
+ const out = {};
+ const matchToProperty = (key, r, modifier) => {
+ const exec = r.exec(info);
+ if (exec) {
+ out[key] = modifier ? modifier(exec[1]) : exec[1];
+ }
+ };
+ matchToProperty('uuid', /\n *RequestUUID: (.+?)\n/);
+ matchToProperty('date', /\n *Date: (.+?)\n/, d => new Date(d));
+ matchToProperty('status', /\n *Status: (.+?)\n/);
+ matchToProperty('logFileUrl', /\n *LogFileURL: (.+?)\n/);
+ matchToProperty('statusCode', /\n *Status Code: (.+?)\n/, n => parseInt(n, 10));
+ matchToProperty('statusMessage', /\n *Status Message: (.+?)\n/);
+ if (out.logFileUrl === '(null)') {
+ out.logFileUrl = null;
+ }
+ return out;
+}
+exports.parseNotarizationInfo = parseNotarizationInfo;
+function delay(ms) {
+ return new Promise(resolve => setTimeout(resolve, ms));
+}
+exports.delay = delay;
+//# sourceMappingURL=helpers.js.map \ No newline at end of file