init
This commit is contained in:
2
mc_test/node_modules/builder-util/out/7za.d.ts
generated
vendored
Executable file
2
mc_test/node_modules/builder-util/out/7za.d.ts
generated
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
export declare function getPath7za(): Promise<string>;
|
||||
export declare function getPath7x(): Promise<string>;
|
||||
16
mc_test/node_modules/builder-util/out/7za.js
generated
vendored
Executable file
16
mc_test/node_modules/builder-util/out/7za.js
generated
vendored
Executable file
@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getPath7x = exports.getPath7za = void 0;
|
||||
const _7zip_bin_1 = require("7zip-bin");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
async function getPath7za() {
|
||||
await (0, fs_extra_1.chmod)(_7zip_bin_1.path7za, 0o755);
|
||||
return _7zip_bin_1.path7za;
|
||||
}
|
||||
exports.getPath7za = getPath7za;
|
||||
async function getPath7x() {
|
||||
await (0, fs_extra_1.chmod)(_7zip_bin_1.path7x, 0o755);
|
||||
return _7zip_bin_1.path7x;
|
||||
}
|
||||
exports.getPath7x = getPath7x;
|
||||
//# sourceMappingURL=7za.js.map
|
||||
1
mc_test/node_modules/builder-util/out/7za.js.map
generated
vendored
Executable file
1
mc_test/node_modules/builder-util/out/7za.js.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"7za.js","sourceRoot":"","sources":["../src/7za.ts"],"names":[],"mappings":";;;AAAA,wCAA0C;AAC1C,uCAAgC;AAEzB,KAAK,UAAU,UAAU;IAC9B,MAAM,IAAA,gBAAK,EAAC,mBAAO,EAAE,KAAK,CAAC,CAAA;IAC3B,OAAO,mBAAO,CAAA;AAChB,CAAC;AAHD,gCAGC;AAEM,KAAK,UAAU,SAAS;IAC7B,MAAM,IAAA,gBAAK,EAAC,kBAAM,EAAE,KAAK,CAAC,CAAA;IAC1B,OAAO,kBAAM,CAAA;AACf,CAAC;AAHD,8BAGC","sourcesContent":["import { path7x, path7za } from \"7zip-bin\"\nimport { chmod } from \"fs-extra\"\n\nexport async function getPath7za(): Promise<string> {\n await chmod(path7za, 0o755)\n return path7za\n}\n\nexport async function getPath7x(): Promise<string> {\n await chmod(path7x, 0o755)\n return path7x\n}\n"]}
|
||||
7
mc_test/node_modules/builder-util/out/DebugLogger.d.ts
generated
vendored
Executable file
7
mc_test/node_modules/builder-util/out/DebugLogger.d.ts
generated
vendored
Executable file
@ -0,0 +1,7 @@
|
||||
export declare class DebugLogger {
|
||||
readonly isEnabled: boolean;
|
||||
readonly data: any;
|
||||
constructor(isEnabled?: boolean);
|
||||
add(key: string, value: any): void;
|
||||
save(file: string): Promise<void>;
|
||||
}
|
||||
51
mc_test/node_modules/builder-util/out/DebugLogger.js
generated
vendored
Executable file
51
mc_test/node_modules/builder-util/out/DebugLogger.js
generated
vendored
Executable file
@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DebugLogger = void 0;
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const util_1 = require("./util");
|
||||
class DebugLogger {
|
||||
constructor(isEnabled = true) {
|
||||
this.isEnabled = isEnabled;
|
||||
this.data = {};
|
||||
}
|
||||
add(key, value) {
|
||||
if (!this.isEnabled) {
|
||||
return;
|
||||
}
|
||||
const dataPath = key.split(".");
|
||||
let o = this.data;
|
||||
let lastName = null;
|
||||
for (const p of dataPath) {
|
||||
if (p === dataPath[dataPath.length - 1]) {
|
||||
lastName = p;
|
||||
break;
|
||||
}
|
||||
else {
|
||||
if (o[p] == null) {
|
||||
o[p] = Object.create(null);
|
||||
}
|
||||
else if (typeof o[p] === "string") {
|
||||
o[p] = [o[p]];
|
||||
}
|
||||
o = o[p];
|
||||
}
|
||||
}
|
||||
if (Array.isArray(o[lastName])) {
|
||||
o[lastName] = [...o[lastName], value];
|
||||
}
|
||||
else {
|
||||
o[lastName] = value;
|
||||
}
|
||||
}
|
||||
save(file) {
|
||||
// toml and json doesn't correctly output multiline string as multiline
|
||||
if (this.isEnabled && Object.keys(this.data).length > 0) {
|
||||
return (0, fs_extra_1.outputFile)(file, (0, util_1.serializeToYaml)(this.data));
|
||||
}
|
||||
else {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.DebugLogger = DebugLogger;
|
||||
//# sourceMappingURL=DebugLogger.js.map
|
||||
1
mc_test/node_modules/builder-util/out/DebugLogger.js.map
generated
vendored
Executable file
1
mc_test/node_modules/builder-util/out/DebugLogger.js.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"DebugLogger.js","sourceRoot":"","sources":["../src/DebugLogger.ts"],"names":[],"mappings":";;;AAAA,uCAAqC;AACrC,iCAAwC;AAExC,MAAa,WAAW;IAGtB,YAAqB,YAAY,IAAI;QAAhB,cAAS,GAAT,SAAS,CAAO;QAF5B,SAAI,GAAQ,EAAE,CAAA;IAEiB,CAAC;IAEzC,GAAG,CAAC,GAAW,EAAE,KAAU;QACzB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,OAAM;QACR,CAAC;QAED,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAC/B,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAA;QACjB,IAAI,QAAQ,GAAkB,IAAI,CAAA;QAClC,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;YACzB,IAAI,CAAC,KAAK,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;gBACxC,QAAQ,GAAG,CAAC,CAAA;gBACZ,MAAK;YACP,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;oBACjB,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;gBAC5B,CAAC;qBAAM,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;oBACpC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;gBACf,CAAC;gBACD,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;YACV,CAAC;QACH,CAAC;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,QAAS,CAAC,CAAC,EAAE,CAAC;YAChC,CAAC,CAAC,QAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAS,CAAC,EAAE,KAAK,CAAC,CAAA;QACzC,CAAC;aAAM,CAAC;YACN,CAAC,CAAC,QAAS,CAAC,GAAG,KAAK,CAAA;QACtB,CAAC;IACH,CAAC;IAED,IAAI,CAAC,IAAY;QACf,uEAAuE;QACvE,IAAI,IAAI,CAAC,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxD,OAAO,IAAA,qBAAU,EAAC,IAAI,EAAE,IAAA,sBAAe,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;QACrD,CAAC;aAAM,CAAC;YACN,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;QAC1B,CAAC;IACH,CAAC;CACF;AA1CD,kCA0CC","sourcesContent":["import { outputFile } from \"fs-extra\"\nimport { serializeToYaml } from \"./util\"\n\nexport class DebugLogger {\n readonly data: any = {}\n\n constructor(readonly isEnabled = true) {}\n\n add(key: string, value: any) {\n if (!this.isEnabled) {\n return\n }\n\n const dataPath = key.split(\".\")\n let o = this.data\n let lastName: string | null = null\n for (const p of dataPath) {\n if (p === dataPath[dataPath.length - 1]) {\n lastName = p\n break\n } else {\n if (o[p] == null) {\n o[p] = Object.create(null)\n } else if (typeof o[p] === \"string\") {\n o[p] = [o[p]]\n }\n o = o[p]\n }\n }\n\n if (Array.isArray(o[lastName!])) {\n o[lastName!] = [...o[lastName!], value]\n } else {\n o[lastName!] = value\n }\n }\n\n save(file: string) {\n // toml and json doesn't correctly output multiline string as multiline\n if (this.isEnabled && Object.keys(this.data).length > 0) {\n return outputFile(file, serializeToYaml(this.data))\n } else {\n return Promise.resolve()\n }\n }\n}\n"]}
|
||||
14
mc_test/node_modules/builder-util/out/arch.d.ts
generated
vendored
Executable file
14
mc_test/node_modules/builder-util/out/arch.d.ts
generated
vendored
Executable file
@ -0,0 +1,14 @@
|
||||
export declare enum Arch {
|
||||
ia32 = 0,
|
||||
x64 = 1,
|
||||
armv7l = 2,
|
||||
arm64 = 3,
|
||||
universal = 4
|
||||
}
|
||||
export type ArchType = "x64" | "ia32" | "armv7l" | "arm64" | "universal";
|
||||
export declare function toLinuxArchString(arch: Arch, targetName: string): string;
|
||||
export declare function getArchCliNames(): Array<string>;
|
||||
export declare function getArchSuffix(arch: Arch, defaultArch?: string): string;
|
||||
export declare function archFromString(name: string): Arch;
|
||||
export declare function defaultArchFromString(name?: string): Arch;
|
||||
export declare function getArtifactArchName(arch: Arch, ext: string): string;
|
||||
92
mc_test/node_modules/builder-util/out/arch.js
generated
vendored
Executable file
92
mc_test/node_modules/builder-util/out/arch.js
generated
vendored
Executable file
@ -0,0 +1,92 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getArtifactArchName = exports.defaultArchFromString = exports.archFromString = exports.getArchSuffix = exports.getArchCliNames = exports.toLinuxArchString = exports.Arch = void 0;
|
||||
var Arch;
|
||||
(function (Arch) {
|
||||
Arch[Arch["ia32"] = 0] = "ia32";
|
||||
Arch[Arch["x64"] = 1] = "x64";
|
||||
Arch[Arch["armv7l"] = 2] = "armv7l";
|
||||
Arch[Arch["arm64"] = 3] = "arm64";
|
||||
Arch[Arch["universal"] = 4] = "universal";
|
||||
})(Arch || (exports.Arch = Arch = {}));
|
||||
function toLinuxArchString(arch, targetName) {
|
||||
switch (arch) {
|
||||
case Arch.x64:
|
||||
return targetName === "flatpak" ? "x86_64" : "amd64";
|
||||
case Arch.ia32:
|
||||
return targetName === "pacman" ? "i686" : "i386";
|
||||
case Arch.armv7l:
|
||||
return targetName === "snap" || targetName === "deb" ? "armhf" : targetName === "flatpak" ? "arm" : "armv7l";
|
||||
case Arch.arm64:
|
||||
return targetName === "pacman" || targetName === "rpm" || targetName === "flatpak" ? "aarch64" : "arm64";
|
||||
default:
|
||||
throw new Error(`Unsupported arch ${arch}`);
|
||||
}
|
||||
}
|
||||
exports.toLinuxArchString = toLinuxArchString;
|
||||
function getArchCliNames() {
|
||||
return [Arch[Arch.ia32], Arch[Arch.x64], Arch[Arch.armv7l], Arch[Arch.arm64]];
|
||||
}
|
||||
exports.getArchCliNames = getArchCliNames;
|
||||
function getArchSuffix(arch, defaultArch) {
|
||||
return arch === defaultArchFromString(defaultArch) ? "" : `-${Arch[arch]}`;
|
||||
}
|
||||
exports.getArchSuffix = getArchSuffix;
|
||||
function archFromString(name) {
|
||||
switch (name) {
|
||||
case "x64":
|
||||
return Arch.x64;
|
||||
case "ia32":
|
||||
return Arch.ia32;
|
||||
case "arm64":
|
||||
return Arch.arm64;
|
||||
case "arm":
|
||||
case "armv7l":
|
||||
return Arch.armv7l;
|
||||
case "universal":
|
||||
return Arch.universal;
|
||||
default:
|
||||
throw new Error(`Unsupported arch ${name}`);
|
||||
}
|
||||
}
|
||||
exports.archFromString = archFromString;
|
||||
function defaultArchFromString(name) {
|
||||
return name ? archFromString(name) : Arch.x64;
|
||||
}
|
||||
exports.defaultArchFromString = defaultArchFromString;
|
||||
function getArtifactArchName(arch, ext) {
|
||||
let archName = Arch[arch];
|
||||
const isAppImage = ext === "AppImage" || ext === "appimage";
|
||||
if (arch === Arch.x64) {
|
||||
if (isAppImage || ext === "rpm" || ext === "flatpak") {
|
||||
archName = "x86_64";
|
||||
}
|
||||
else if (ext === "deb" || ext === "snap") {
|
||||
archName = "amd64";
|
||||
}
|
||||
}
|
||||
else if (arch === Arch.ia32) {
|
||||
if (ext === "deb" || isAppImage || ext === "snap" || ext === "flatpak") {
|
||||
archName = "i386";
|
||||
}
|
||||
else if (ext === "pacman" || ext === "rpm") {
|
||||
archName = "i686";
|
||||
}
|
||||
}
|
||||
else if (arch === Arch.armv7l) {
|
||||
if (ext === "snap") {
|
||||
archName = "armhf";
|
||||
}
|
||||
else if (ext === "flatpak") {
|
||||
archName = "arm";
|
||||
}
|
||||
}
|
||||
else if (arch === Arch.arm64) {
|
||||
if (ext === "pacman" || ext === "rpm" || ext === "flatpak") {
|
||||
archName = "aarch64";
|
||||
}
|
||||
}
|
||||
return archName;
|
||||
}
|
||||
exports.getArtifactArchName = getArtifactArchName;
|
||||
//# sourceMappingURL=arch.js.map
|
||||
1
mc_test/node_modules/builder-util/out/arch.js.map
generated
vendored
Executable file
1
mc_test/node_modules/builder-util/out/arch.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
11
mc_test/node_modules/builder-util/out/asyncTaskManager.d.ts
generated
vendored
Executable file
11
mc_test/node_modules/builder-util/out/asyncTaskManager.d.ts
generated
vendored
Executable file
@ -0,0 +1,11 @@
|
||||
import { CancellationToken } from "builder-util-runtime";
|
||||
export declare class AsyncTaskManager {
|
||||
private readonly cancellationToken;
|
||||
readonly tasks: Array<Promise<any>>;
|
||||
private readonly errors;
|
||||
constructor(cancellationToken: CancellationToken);
|
||||
add(task: () => Promise<any>): void;
|
||||
addTask(promise: Promise<any>): void;
|
||||
cancelTasks(): void;
|
||||
awaitTasks(): Promise<Array<any>>;
|
||||
}
|
||||
87
mc_test/node_modules/builder-util/out/asyncTaskManager.js
generated
vendored
Executable file
87
mc_test/node_modules/builder-util/out/asyncTaskManager.js
generated
vendored
Executable file
@ -0,0 +1,87 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AsyncTaskManager = void 0;
|
||||
const log_1 = require("./log");
|
||||
const promise_1 = require("./promise");
|
||||
class AsyncTaskManager {
|
||||
constructor(cancellationToken) {
|
||||
this.cancellationToken = cancellationToken;
|
||||
this.tasks = [];
|
||||
this.errors = [];
|
||||
}
|
||||
add(task) {
|
||||
if (this.cancellationToken == null || !this.cancellationToken.cancelled) {
|
||||
this.addTask(task());
|
||||
}
|
||||
}
|
||||
addTask(promise) {
|
||||
if (this.cancellationToken.cancelled) {
|
||||
log_1.log.debug({ reason: "cancelled", stack: new Error().stack }, "async task not added");
|
||||
if ("cancel" in promise) {
|
||||
;
|
||||
promise.cancel();
|
||||
}
|
||||
return;
|
||||
}
|
||||
this.tasks.push(promise.catch(it => {
|
||||
log_1.log.debug({ error: it.message || it.toString() }, "async task error");
|
||||
this.errors.push(it);
|
||||
return Promise.resolve(null);
|
||||
}));
|
||||
}
|
||||
cancelTasks() {
|
||||
for (const task of this.tasks) {
|
||||
if ("cancel" in task) {
|
||||
;
|
||||
task.cancel();
|
||||
}
|
||||
}
|
||||
this.tasks.length = 0;
|
||||
}
|
||||
async awaitTasks() {
|
||||
if (this.cancellationToken.cancelled) {
|
||||
this.cancelTasks();
|
||||
return [];
|
||||
}
|
||||
const checkErrors = () => {
|
||||
if (this.errors.length > 0) {
|
||||
this.cancelTasks();
|
||||
throwError(this.errors);
|
||||
return;
|
||||
}
|
||||
};
|
||||
checkErrors();
|
||||
let result = null;
|
||||
const tasks = this.tasks;
|
||||
let list = tasks.slice();
|
||||
tasks.length = 0;
|
||||
while (list.length > 0) {
|
||||
const subResult = await Promise.all(list);
|
||||
result = result == null ? subResult : result.concat(subResult);
|
||||
checkErrors();
|
||||
if (tasks.length === 0) {
|
||||
break;
|
||||
}
|
||||
else {
|
||||
if (this.cancellationToken.cancelled) {
|
||||
this.cancelTasks();
|
||||
return [];
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
list = tasks.slice();
|
||||
tasks.length = 0;
|
||||
}
|
||||
}
|
||||
return result || [];
|
||||
}
|
||||
}
|
||||
exports.AsyncTaskManager = AsyncTaskManager;
|
||||
function throwError(errors) {
|
||||
if (errors.length === 1) {
|
||||
throw errors[0];
|
||||
}
|
||||
else if (errors.length > 1) {
|
||||
throw new promise_1.NestedError(errors, "Cannot cleanup: ");
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=asyncTaskManager.js.map
|
||||
1
mc_test/node_modules/builder-util/out/asyncTaskManager.js.map
generated
vendored
Executable file
1
mc_test/node_modules/builder-util/out/asyncTaskManager.js.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"asyncTaskManager.js","sourceRoot":"","sources":["../src/asyncTaskManager.ts"],"names":[],"mappings":";;;AACA,+BAA2B;AAC3B,uCAAuC;AAEvC,MAAa,gBAAgB;IAI3B,YAA6B,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;QAHxD,UAAK,GAAwB,EAAE,CAAA;QACvB,WAAM,GAAiB,EAAE,CAAA;IAE0B,CAAC;IAErE,GAAG,CAAC,IAAwB;QAC1B,IAAI,IAAI,CAAC,iBAAiB,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC;YACxE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAA;QACtB,CAAC;IACH,CAAC;IAED,OAAO,CAAC,OAAqB;QAC3B,IAAI,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC;YACrC,SAAG,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,sBAAsB,CAAC,CAAA;YACpF,IAAI,QAAQ,IAAI,OAAO,EAAE,CAAC;gBACxB,CAAC;gBAAC,OAAe,CAAC,MAAM,EAAE,CAAA;YAC5B,CAAC;YACD,OAAM;QACR,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,IAAI,CACb,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE;YACjB,SAAG,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,kBAAkB,CAAC,CAAA;YACrE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YACpB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAC9B,CAAC,CAAC,CACH,CAAA;IACH,CAAC;IAED,WAAW;QACT,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC9B,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;gBACrB,CAAC;gBAAC,IAAY,CAAC,MAAM,EAAE,CAAA;YACzB,CAAC;QACH,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;IACvB,CAAC;IAED,KAAK,CAAC,UAAU;QACd,IAAI,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC;YACrC,IAAI,CAAC,WAAW,EAAE,CAAA;YAClB,OAAO,EAAE,CAAA;QACX,CAAC;QAED,MAAM,WAAW,GAAG,GAAG,EAAE;YACvB,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC3B,IAAI,CAAC,WAAW,EAAE,CAAA;gBAClB,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBACvB,OAAM;YACR,CAAC;QACH,CAAC,CAAA;QAED,WAAW,EAAE,CAAA;QAEb,IAAI,MAAM,GAAsB,IAAI,CAAA;QACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,GAAG,KAAK,CAAC,KAAK,EAAE,CAAA;QACxB,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;QAChB,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YACzC,MAAM,GAAG,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;YAC9D,WAAW,EAAE,CAAA;YACb,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACvB,MAAK;YACP,CAAC;iBAAM,CAAC;gBACN,IAAI,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC;oBACrC,IAAI,CAAC,WAAW,EAAE,CAAA;oBAClB,OAAO,EAAE,CAAA;gBACX,CAAC;gBAED,mEAAmE;gBACnE,IAAI,GAAG,KAAK,CAAC,KAAK,EAAE,CAAA;gBACpB,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;YAClB,CAAC;QACH,CAAC;QACD,OAAO,MAAM,IAAI,EAAE,CAAA;IACrB,CAAC;CACF;AA9ED,4CA8EC;AAED,SAAS,UAAU,CAAC,MAAoB;IACtC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,MAAM,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;SAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,qBAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;IACnD,CAAC;AACH,CAAC","sourcesContent":["import { CancellationToken } from \"builder-util-runtime\"\nimport { log } from \"./log\"\nimport { NestedError } from \"./promise\"\n\nexport class AsyncTaskManager {\n readonly tasks: Array<Promise<any>> = []\n private readonly errors: Array<Error> = []\n\n constructor(private readonly cancellationToken: CancellationToken) {}\n\n add(task: () => Promise<any>) {\n if (this.cancellationToken == null || !this.cancellationToken.cancelled) {\n this.addTask(task())\n }\n }\n\n addTask(promise: Promise<any>) {\n if (this.cancellationToken.cancelled) {\n log.debug({ reason: \"cancelled\", stack: new Error().stack }, \"async task not added\")\n if (\"cancel\" in promise) {\n ;(promise as any).cancel()\n }\n return\n }\n\n this.tasks.push(\n promise.catch(it => {\n log.debug({ error: it.message || it.toString() }, \"async task error\")\n this.errors.push(it)\n return Promise.resolve(null)\n })\n )\n }\n\n cancelTasks() {\n for (const task of this.tasks) {\n if (\"cancel\" in task) {\n ;(task as any).cancel()\n }\n }\n this.tasks.length = 0\n }\n\n async awaitTasks(): Promise<Array<any>> {\n if (this.cancellationToken.cancelled) {\n this.cancelTasks()\n return []\n }\n\n const checkErrors = () => {\n if (this.errors.length > 0) {\n this.cancelTasks()\n throwError(this.errors)\n return\n }\n }\n\n checkErrors()\n\n let result: Array<any> | null = null\n const tasks = this.tasks\n let list = tasks.slice()\n tasks.length = 0\n while (list.length > 0) {\n const subResult = await Promise.all(list)\n result = result == null ? subResult : result.concat(subResult)\n checkErrors()\n if (tasks.length === 0) {\n break\n } else {\n if (this.cancellationToken.cancelled) {\n this.cancelTasks()\n return []\n }\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n list = tasks.slice()\n tasks.length = 0\n }\n }\n return result || []\n }\n}\n\nfunction throwError(errors: Array<Error>) {\n if (errors.length === 1) {\n throw errors[0]\n } else if (errors.length > 1) {\n throw new NestedError(errors, \"Cannot cleanup: \")\n }\n}\n"]}
|
||||
1
mc_test/node_modules/builder-util/out/deepAssign.d.ts
generated
vendored
Executable file
1
mc_test/node_modules/builder-util/out/deepAssign.d.ts
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
export declare function deepAssign<T>(target: T, ...objects: Array<any>): T;
|
||||
48
mc_test/node_modules/builder-util/out/deepAssign.js
generated
vendored
Executable file
48
mc_test/node_modules/builder-util/out/deepAssign.js
generated
vendored
Executable file
@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.deepAssign = void 0;
|
||||
function isObject(x) {
|
||||
if (Array.isArray(x)) {
|
||||
return false;
|
||||
}
|
||||
const type = typeof x;
|
||||
return type === "object" || type === "function";
|
||||
}
|
||||
function assignKey(target, from, key) {
|
||||
const value = from[key];
|
||||
// https://github.com/electron-userland/electron-builder/pull/562
|
||||
if (value === undefined) {
|
||||
return;
|
||||
}
|
||||
const prevValue = target[key];
|
||||
if (prevValue == null || value == null || !isObject(prevValue) || !isObject(value)) {
|
||||
// Merge arrays.
|
||||
if (Array.isArray(prevValue) && Array.isArray(value)) {
|
||||
target[key] = Array.from(new Set(prevValue.concat(value)));
|
||||
}
|
||||
else {
|
||||
target[key] = value;
|
||||
}
|
||||
}
|
||||
else {
|
||||
target[key] = assign(prevValue, value);
|
||||
}
|
||||
}
|
||||
function assign(to, from) {
|
||||
if (to !== from) {
|
||||
for (const key of Object.getOwnPropertyNames(from)) {
|
||||
assignKey(to, from, key);
|
||||
}
|
||||
}
|
||||
return to;
|
||||
}
|
||||
function deepAssign(target, ...objects) {
|
||||
for (const o of objects) {
|
||||
if (o != null) {
|
||||
assign(target, o);
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
exports.deepAssign = deepAssign;
|
||||
//# sourceMappingURL=deepAssign.js.map
|
||||
1
mc_test/node_modules/builder-util/out/deepAssign.js.map
generated
vendored
Executable file
1
mc_test/node_modules/builder-util/out/deepAssign.js.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"deepAssign.js","sourceRoot":"","sources":["../src/deepAssign.ts"],"names":[],"mappings":";;;AAAA,SAAS,QAAQ,CAAC,CAAM;IACtB,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACrB,OAAO,KAAK,CAAA;IACd,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,CAAA;IACrB,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,UAAU,CAAA;AACjD,CAAC;AAED,SAAS,SAAS,CAAC,MAAW,EAAE,IAAS,EAAE,GAAW;IACpD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;IACvB,iEAAiE;IACjE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAM;IACR,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;IAC7B,IAAI,SAAS,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACnF,gBAAgB;QAChB,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACrD,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAC5D,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;QACrB,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;IACxC,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAC,EAAO,EAAE,IAAS;IAChC,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC;QAChB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;YACnD,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;QAC1B,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC;AAED,SAAgB,UAAU,CAAI,MAAS,EAAE,GAAG,OAAmB;IAC7D,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;YACd,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAPD,gCAOC","sourcesContent":["function isObject(x: any) {\n if (Array.isArray(x)) {\n return false\n }\n\n const type = typeof x\n return type === \"object\" || type === \"function\"\n}\n\nfunction assignKey(target: any, from: any, key: string) {\n const value = from[key]\n // https://github.com/electron-userland/electron-builder/pull/562\n if (value === undefined) {\n return\n }\n\n const prevValue = target[key]\n if (prevValue == null || value == null || !isObject(prevValue) || !isObject(value)) {\n // Merge arrays.\n if (Array.isArray(prevValue) && Array.isArray(value)) {\n target[key] = Array.from(new Set(prevValue.concat(value)))\n } else {\n target[key] = value\n }\n } else {\n target[key] = assign(prevValue, value)\n }\n}\n\nfunction assign(to: any, from: any) {\n if (to !== from) {\n for (const key of Object.getOwnPropertyNames(from)) {\n assignKey(to, from, key)\n }\n }\n return to\n}\n\nexport function deepAssign<T>(target: T, ...objects: Array<any>): T {\n for (const o of objects) {\n if (o != null) {\n assign(target, o)\n }\n }\n return target\n}\n"]}
|
||||
60
mc_test/node_modules/builder-util/out/fs.d.ts
generated
vendored
Executable file
60
mc_test/node_modules/builder-util/out/fs.d.ts
generated
vendored
Executable file
@ -0,0 +1,60 @@
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
import { Stats } from "fs";
|
||||
export declare const MAX_FILE_REQUESTS = 8;
|
||||
export declare const CONCURRENCY: {
|
||||
concurrency: number;
|
||||
};
|
||||
export type AfterCopyFileTransformer = (file: string) => Promise<boolean>;
|
||||
export declare class CopyFileTransformer {
|
||||
readonly afterCopyTransformer: AfterCopyFileTransformer;
|
||||
constructor(afterCopyTransformer: AfterCopyFileTransformer);
|
||||
}
|
||||
export type FileTransformer = (file: string) => Promise<null | string | Buffer | CopyFileTransformer> | null | string | Buffer | CopyFileTransformer;
|
||||
export type Filter = (file: string, stat: Stats) => boolean;
|
||||
export declare function unlinkIfExists(file: string): Promise<void>;
|
||||
export declare function statOrNull(file: string): Promise<Stats | null>;
|
||||
export declare function exists(file: string): Promise<boolean>;
|
||||
export interface FileConsumer {
|
||||
consume(file: string, fileStat: Stats, parent: string, siblingNames: Array<string>): any;
|
||||
/**
|
||||
* @default false
|
||||
*/
|
||||
isIncludeDir?: boolean;
|
||||
}
|
||||
/**
|
||||
* Returns list of file paths (system-dependent file separator)
|
||||
*/
|
||||
export declare function walk(initialDirPath: string, filter?: Filter | null, consumer?: FileConsumer): Promise<Array<string>>;
|
||||
export declare function copyFile(src: string, dest: string, isEnsureDir?: boolean): Promise<any>;
|
||||
/**
|
||||
* Hard links is used if supported and allowed.
|
||||
* File permission is fixed — allow execute for all if owner can, allow read for all if owner can.
|
||||
*
|
||||
* ensureDir is not called, dest parent dir must exists
|
||||
*/
|
||||
export declare function copyOrLinkFile(src: string, dest: string, stats?: Stats | null, isUseHardLink?: boolean, exDevErrorHandler?: (() => boolean) | null): Promise<any>;
|
||||
export declare class FileCopier {
|
||||
private readonly isUseHardLinkFunction?;
|
||||
private readonly transformer?;
|
||||
isUseHardLink: boolean;
|
||||
constructor(isUseHardLinkFunction?: ((file: string) => boolean) | null | undefined, transformer?: FileTransformer | null | undefined);
|
||||
copy(src: string, dest: string, stat: Stats | undefined): Promise<void>;
|
||||
}
|
||||
export interface CopyDirOptions {
|
||||
filter?: Filter | null;
|
||||
transformer?: FileTransformer | null;
|
||||
isUseHardLink?: ((file: string) => boolean) | null;
|
||||
}
|
||||
/**
|
||||
* Empty directories is never created.
|
||||
* Hard links is used if supported and allowed.
|
||||
*/
|
||||
export declare function copyDir(src: string, destination: string, options?: CopyDirOptions): Promise<any>;
|
||||
export declare function dirSize(dirPath: string): Promise<number>;
|
||||
export declare const DO_NOT_USE_HARD_LINKS: (file: string) => boolean;
|
||||
export declare const USE_HARD_LINKS: (file: string) => boolean;
|
||||
export interface Link {
|
||||
readonly link: string;
|
||||
readonly file: string;
|
||||
}
|
||||
287
mc_test/node_modules/builder-util/out/fs.js
generated
vendored
Executable file
287
mc_test/node_modules/builder-util/out/fs.js
generated
vendored
Executable file
@ -0,0 +1,287 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.USE_HARD_LINKS = exports.DO_NOT_USE_HARD_LINKS = exports.dirSize = exports.copyDir = exports.FileCopier = exports.copyOrLinkFile = exports.copyFile = exports.walk = exports.exists = exports.statOrNull = exports.unlinkIfExists = exports.CopyFileTransformer = exports.CONCURRENCY = exports.MAX_FILE_REQUESTS = void 0;
|
||||
const bluebird_lst_1 = require("bluebird-lst");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const os_1 = require("os");
|
||||
const promises_1 = require("fs/promises");
|
||||
const path = require("path");
|
||||
const stat_mode_1 = require("stat-mode");
|
||||
const log_1 = require("./log");
|
||||
const promise_1 = require("./promise");
|
||||
const isCI = require("is-ci");
|
||||
exports.MAX_FILE_REQUESTS = 8;
|
||||
exports.CONCURRENCY = { concurrency: exports.MAX_FILE_REQUESTS };
|
||||
class CopyFileTransformer {
|
||||
constructor(afterCopyTransformer) {
|
||||
this.afterCopyTransformer = afterCopyTransformer;
|
||||
}
|
||||
}
|
||||
exports.CopyFileTransformer = CopyFileTransformer;
|
||||
function unlinkIfExists(file) {
|
||||
return (0, promises_1.unlink)(file).catch(() => {
|
||||
/* ignore */
|
||||
});
|
||||
}
|
||||
exports.unlinkIfExists = unlinkIfExists;
|
||||
async function statOrNull(file) {
|
||||
return (0, promise_1.orNullIfFileNotExist)((0, promises_1.stat)(file));
|
||||
}
|
||||
exports.statOrNull = statOrNull;
|
||||
async function exists(file) {
|
||||
try {
|
||||
await (0, promises_1.access)(file);
|
||||
return true;
|
||||
}
|
||||
catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
exports.exists = exists;
|
||||
/**
|
||||
* Returns list of file paths (system-dependent file separator)
|
||||
*/
|
||||
async function walk(initialDirPath, filter, consumer) {
|
||||
let result = [];
|
||||
const queue = [initialDirPath];
|
||||
let addDirToResult = false;
|
||||
const isIncludeDir = consumer == null ? false : consumer.isIncludeDir === true;
|
||||
while (queue.length > 0) {
|
||||
const dirPath = queue.pop();
|
||||
if (isIncludeDir) {
|
||||
if (addDirToResult) {
|
||||
result.push(dirPath);
|
||||
}
|
||||
else {
|
||||
addDirToResult = true;
|
||||
}
|
||||
}
|
||||
const childNames = await (0, promise_1.orIfFileNotExist)((0, promises_1.readdir)(dirPath), []);
|
||||
childNames.sort();
|
||||
let nodeModuleContent = null;
|
||||
const dirs = [];
|
||||
// our handler is async, but we should add sorted files, so, we add file to result not in the mapper, but after map
|
||||
const sortedFilePaths = await bluebird_lst_1.default.map(childNames, name => {
|
||||
if (name === ".DS_Store" || name === ".gitkeep") {
|
||||
return null;
|
||||
}
|
||||
const filePath = dirPath + path.sep + name;
|
||||
return (0, promises_1.lstat)(filePath).then(stat => {
|
||||
if (filter != null && !filter(filePath, stat)) {
|
||||
return null;
|
||||
}
|
||||
const consumerResult = consumer == null ? null : consumer.consume(filePath, stat, dirPath, childNames);
|
||||
if (consumerResult === false) {
|
||||
return null;
|
||||
}
|
||||
else if (consumerResult == null || !("then" in consumerResult)) {
|
||||
if (stat.isDirectory()) {
|
||||
dirs.push(name);
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
return filePath;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return consumerResult.then((it) => {
|
||||
if (it != null && Array.isArray(it)) {
|
||||
nodeModuleContent = it;
|
||||
return null;
|
||||
}
|
||||
// asarUtil can return modified stat (symlink handling)
|
||||
if ((it != null && "isDirectory" in it ? it : stat).isDirectory()) {
|
||||
dirs.push(name);
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
return filePath;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}, exports.CONCURRENCY);
|
||||
for (const child of sortedFilePaths) {
|
||||
if (child != null) {
|
||||
result.push(child);
|
||||
}
|
||||
}
|
||||
dirs.sort();
|
||||
for (const child of dirs) {
|
||||
queue.push(dirPath + path.sep + child);
|
||||
}
|
||||
if (nodeModuleContent != null) {
|
||||
result = result.concat(nodeModuleContent);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
exports.walk = walk;
|
||||
const _isUseHardLink = process.platform !== "win32" && process.env.USE_HARD_LINKS !== "false" && (isCI || process.env.USE_HARD_LINKS === "true");
|
||||
function copyFile(src, dest, isEnsureDir = true) {
|
||||
return (isEnsureDir ? (0, promises_1.mkdir)(path.dirname(dest), { recursive: true }) : Promise.resolve()).then(() => copyOrLinkFile(src, dest, null, false));
|
||||
}
|
||||
exports.copyFile = copyFile;
|
||||
/**
|
||||
* Hard links is used if supported and allowed.
|
||||
* File permission is fixed — allow execute for all if owner can, allow read for all if owner can.
|
||||
*
|
||||
* ensureDir is not called, dest parent dir must exists
|
||||
*/
|
||||
function copyOrLinkFile(src, dest, stats, isUseHardLink, exDevErrorHandler) {
|
||||
if (isUseHardLink === undefined) {
|
||||
isUseHardLink = _isUseHardLink;
|
||||
}
|
||||
if (stats != null) {
|
||||
const originalModeNumber = stats.mode;
|
||||
const mode = new stat_mode_1.Mode(stats);
|
||||
if (mode.owner.execute) {
|
||||
mode.group.execute = true;
|
||||
mode.others.execute = true;
|
||||
}
|
||||
mode.group.read = true;
|
||||
mode.others.read = true;
|
||||
mode.setuid = false;
|
||||
mode.setgid = false;
|
||||
if (originalModeNumber !== stats.mode) {
|
||||
if (log_1.log.isDebugEnabled) {
|
||||
const oldMode = new stat_mode_1.Mode({ mode: originalModeNumber });
|
||||
log_1.log.debug({ file: dest, oldMode, mode }, "permissions fixed from");
|
||||
}
|
||||
// https://helgeklein.com/blog/2009/05/hard-links-and-permissions-acls/
|
||||
// Permissions on all hard links to the same data on disk are always identical. The same applies to attributes.
|
||||
// That means if you change the permissions/owner/attributes on one hard link, you will immediately see the changes on all other hard links.
|
||||
if (isUseHardLink) {
|
||||
isUseHardLink = false;
|
||||
log_1.log.debug({ dest }, "copied, but not linked, because file permissions need to be fixed");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isUseHardLink) {
|
||||
return (0, promises_1.link)(src, dest).catch((e) => {
|
||||
if (e.code === "EXDEV") {
|
||||
const isLog = exDevErrorHandler == null ? true : exDevErrorHandler();
|
||||
if (isLog && log_1.log.isDebugEnabled) {
|
||||
log_1.log.debug({ error: e.message }, "cannot copy using hard link");
|
||||
}
|
||||
return doCopyFile(src, dest, stats);
|
||||
}
|
||||
else {
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
}
|
||||
return doCopyFile(src, dest, stats);
|
||||
}
|
||||
exports.copyOrLinkFile = copyOrLinkFile;
|
||||
function doCopyFile(src, dest, stats) {
|
||||
const promise = (0, fs_extra_1.copyFile)(src, dest);
|
||||
if (stats == null) {
|
||||
return promise;
|
||||
}
|
||||
return promise.then(() => (0, promises_1.chmod)(dest, stats.mode));
|
||||
}
|
||||
class FileCopier {
|
||||
constructor(isUseHardLinkFunction, transformer) {
|
||||
this.isUseHardLinkFunction = isUseHardLinkFunction;
|
||||
this.transformer = transformer;
|
||||
if (isUseHardLinkFunction === exports.USE_HARD_LINKS) {
|
||||
this.isUseHardLink = true;
|
||||
}
|
||||
else {
|
||||
this.isUseHardLink = _isUseHardLink && isUseHardLinkFunction !== exports.DO_NOT_USE_HARD_LINKS;
|
||||
}
|
||||
}
|
||||
async copy(src, dest, stat) {
|
||||
let afterCopyTransformer = null;
|
||||
if (this.transformer != null && stat != null && stat.isFile()) {
|
||||
let data = this.transformer(src);
|
||||
if (data != null) {
|
||||
if (typeof data === "object" && "then" in data) {
|
||||
data = await data;
|
||||
}
|
||||
if (data != null) {
|
||||
if (data instanceof CopyFileTransformer) {
|
||||
afterCopyTransformer = data.afterCopyTransformer;
|
||||
}
|
||||
else {
|
||||
await (0, promises_1.writeFile)(dest, data);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const isUseHardLink = afterCopyTransformer == null && (!this.isUseHardLink || this.isUseHardLinkFunction == null ? this.isUseHardLink : this.isUseHardLinkFunction(dest));
|
||||
await copyOrLinkFile(src, dest, stat, isUseHardLink, isUseHardLink
|
||||
? () => {
|
||||
// files are copied concurrently, so, we must not check here currentIsUseHardLink — our code can be executed after that other handler will set currentIsUseHardLink to false
|
||||
if (this.isUseHardLink) {
|
||||
this.isUseHardLink = false;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
: null);
|
||||
if (afterCopyTransformer != null) {
|
||||
await afterCopyTransformer(dest);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.FileCopier = FileCopier;
|
||||
/**
|
||||
* Empty directories is never created.
|
||||
* Hard links is used if supported and allowed.
|
||||
*/
|
||||
function copyDir(src, destination, options = {}) {
|
||||
const fileCopier = new FileCopier(options.isUseHardLink, options.transformer);
|
||||
if (log_1.log.isDebugEnabled) {
|
||||
log_1.log.debug({ src, destination }, `copying${fileCopier.isUseHardLink ? " using hard links" : ""}`);
|
||||
}
|
||||
const createdSourceDirs = new Set();
|
||||
const links = [];
|
||||
const symlinkType = (0, os_1.platform)() === "win32" ? "junction" : "file";
|
||||
return walk(src, options.filter, {
|
||||
consume: async (file, stat, parent) => {
|
||||
if (!stat.isFile() && !stat.isSymbolicLink()) {
|
||||
return;
|
||||
}
|
||||
if (!createdSourceDirs.has(parent)) {
|
||||
await (0, promises_1.mkdir)(parent.replace(src, destination), { recursive: true });
|
||||
createdSourceDirs.add(parent);
|
||||
}
|
||||
const destFile = file.replace(src, destination);
|
||||
if (stat.isFile()) {
|
||||
await fileCopier.copy(file, destFile, stat);
|
||||
}
|
||||
else {
|
||||
links.push({ file: destFile, link: await (0, promises_1.readlink)(file) });
|
||||
}
|
||||
},
|
||||
}).then(() => bluebird_lst_1.default.map(links, it => (0, promises_1.symlink)(it.link, it.file, symlinkType), exports.CONCURRENCY));
|
||||
}
|
||||
exports.copyDir = copyDir;
|
||||
async function dirSize(dirPath) {
|
||||
const entries = await (0, promises_1.readdir)(dirPath, { withFileTypes: true });
|
||||
const entrySizes = entries.map(async (entry) => {
|
||||
const entryPath = path.join(dirPath, entry.name);
|
||||
if (entry.isDirectory()) {
|
||||
return await dirSize(entryPath);
|
||||
}
|
||||
if (entry.isFile()) {
|
||||
const { size } = await (0, promises_1.stat)(entryPath);
|
||||
return size;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
return (await Promise.all(entrySizes)).reduce((entrySize, totalSize) => entrySize + totalSize, 0);
|
||||
}
|
||||
exports.dirSize = dirSize;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const DO_NOT_USE_HARD_LINKS = (file) => false;
|
||||
exports.DO_NOT_USE_HARD_LINKS = DO_NOT_USE_HARD_LINKS;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const USE_HARD_LINKS = (file) => true;
|
||||
exports.USE_HARD_LINKS = USE_HARD_LINKS;
|
||||
//# sourceMappingURL=fs.js.map
|
||||
1
mc_test/node_modules/builder-util/out/fs.js.map
generated
vendored
Executable file
1
mc_test/node_modules/builder-util/out/fs.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
26
mc_test/node_modules/builder-util/out/log.d.ts
generated
vendored
Executable file
26
mc_test/node_modules/builder-util/out/log.d.ts
generated
vendored
Executable file
@ -0,0 +1,26 @@
|
||||
/// <reference types="node" />
|
||||
import _debug from "debug";
|
||||
import WritableStream = NodeJS.WritableStream;
|
||||
export declare const debug: _debug.Debugger;
|
||||
export interface Fields {
|
||||
[index: string]: any;
|
||||
}
|
||||
export declare function setPrinter(value: ((message: string) => void) | null): void;
|
||||
export type LogLevel = "info" | "warn" | "debug" | "notice" | "error";
|
||||
export declare const PADDING = 2;
|
||||
export declare class Logger {
|
||||
protected readonly stream: WritableStream;
|
||||
constructor(stream: WritableStream);
|
||||
messageTransformer: (message: string, level: LogLevel) => string;
|
||||
filePath(file: string): string;
|
||||
get isDebugEnabled(): boolean;
|
||||
info(messageOrFields: Fields | null | string, message?: string): void;
|
||||
error(messageOrFields: Fields | null | string, message?: string): void;
|
||||
warn(messageOrFields: Fields | null | string, message?: string): void;
|
||||
debug(fields: Fields | null, message: string): void;
|
||||
private doLog;
|
||||
private _doLog;
|
||||
static createMessage(message: string, fields: Fields | null, level: LogLevel, color: (it: string) => string, messagePadding?: number): string;
|
||||
log(message: string): void;
|
||||
}
|
||||
export declare const log: Logger;
|
||||
110
mc_test/node_modules/builder-util/out/log.js
generated
vendored
Executable file
110
mc_test/node_modules/builder-util/out/log.js
generated
vendored
Executable file
@ -0,0 +1,110 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.log = exports.Logger = exports.PADDING = exports.setPrinter = exports.debug = void 0;
|
||||
const chalk = require("chalk");
|
||||
const debug_1 = require("debug");
|
||||
let printer = null;
|
||||
exports.debug = (0, debug_1.default)("electron-builder");
|
||||
function setPrinter(value) {
|
||||
printer = value;
|
||||
}
|
||||
exports.setPrinter = setPrinter;
|
||||
exports.PADDING = 2;
|
||||
class Logger {
|
||||
constructor(stream) {
|
||||
this.stream = stream;
|
||||
this.messageTransformer = it => it;
|
||||
}
|
||||
filePath(file) {
|
||||
const cwd = process.cwd();
|
||||
return file.startsWith(cwd) ? file.substring(cwd.length + 1) : file;
|
||||
}
|
||||
// noinspection JSMethodCanBeStatic
|
||||
get isDebugEnabled() {
|
||||
return exports.debug.enabled;
|
||||
}
|
||||
info(messageOrFields, message) {
|
||||
this.doLog(message, messageOrFields, "info");
|
||||
}
|
||||
error(messageOrFields, message) {
|
||||
this.doLog(message, messageOrFields, "error");
|
||||
}
|
||||
warn(messageOrFields, message) {
|
||||
this.doLog(message, messageOrFields, "warn");
|
||||
}
|
||||
debug(fields, message) {
|
||||
if (exports.debug.enabled) {
|
||||
this._doLog(message, fields, "debug");
|
||||
}
|
||||
}
|
||||
doLog(message, messageOrFields, level) {
|
||||
if (message === undefined) {
|
||||
this._doLog(messageOrFields, null, level);
|
||||
}
|
||||
else {
|
||||
this._doLog(message, messageOrFields, level);
|
||||
}
|
||||
}
|
||||
_doLog(message, fields, level) {
|
||||
// noinspection SuspiciousInstanceOfGuard
|
||||
if (message instanceof Error) {
|
||||
message = message.stack || message.toString();
|
||||
}
|
||||
else {
|
||||
message = message.toString();
|
||||
}
|
||||
const levelIndicator = level === "error" ? "⨯" : "•";
|
||||
const color = LEVEL_TO_COLOR[level];
|
||||
this.stream.write(`${" ".repeat(exports.PADDING)}${color(levelIndicator)} `);
|
||||
this.stream.write(Logger.createMessage(this.messageTransformer(message, level), fields, level, color, exports.PADDING + 2 /* level indicator and space */));
|
||||
this.stream.write("\n");
|
||||
}
|
||||
static createMessage(message, fields, level, color, messagePadding = 0) {
|
||||
if (fields == null) {
|
||||
return message;
|
||||
}
|
||||
const fieldPadding = " ".repeat(Math.max(2, 16 - message.length));
|
||||
let text = (level === "error" ? color(message) : message) + fieldPadding;
|
||||
const fieldNames = Object.keys(fields);
|
||||
let counter = 0;
|
||||
for (const name of fieldNames) {
|
||||
let fieldValue = fields[name];
|
||||
let valuePadding = null;
|
||||
// Remove unnecessary line breaks
|
||||
if (fieldValue != null && typeof fieldValue === "string" && fieldValue.includes("\n")) {
|
||||
valuePadding = " ".repeat(messagePadding + message.length + fieldPadding.length + 2);
|
||||
fieldValue = fieldValue.replace(/\n\s*\n/g, `\n${valuePadding}`);
|
||||
}
|
||||
else if (Array.isArray(fieldValue)) {
|
||||
fieldValue = JSON.stringify(fieldValue);
|
||||
}
|
||||
text += `${color(name)}=${fieldValue}`;
|
||||
if (++counter !== fieldNames.length) {
|
||||
if (valuePadding == null) {
|
||||
text += " ";
|
||||
}
|
||||
else {
|
||||
text += "\n" + valuePadding;
|
||||
}
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
log(message) {
|
||||
if (printer == null) {
|
||||
this.stream.write(`${message}\n`);
|
||||
}
|
||||
else {
|
||||
printer(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.Logger = Logger;
|
||||
const LEVEL_TO_COLOR = {
|
||||
info: chalk.blue,
|
||||
warn: chalk.yellow,
|
||||
error: chalk.red,
|
||||
debug: chalk.white,
|
||||
};
|
||||
exports.log = new Logger(process.stdout);
|
||||
//# sourceMappingURL=log.js.map
|
||||
1
mc_test/node_modules/builder-util/out/log.js.map
generated
vendored
Executable file
1
mc_test/node_modules/builder-util/out/log.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
7
mc_test/node_modules/builder-util/out/nodeHttpExecutor.d.ts
generated
vendored
Executable file
7
mc_test/node_modules/builder-util/out/nodeHttpExecutor.d.ts
generated
vendored
Executable file
@ -0,0 +1,7 @@
|
||||
/// <reference types="node" />
|
||||
import { HttpExecutor } from "builder-util-runtime";
|
||||
import { ClientRequest } from "http";
|
||||
export declare class NodeHttpExecutor extends HttpExecutor<ClientRequest> {
|
||||
createRequest(options: any, callback: (response: any) => void): ClientRequest;
|
||||
}
|
||||
export declare const httpExecutor: NodeHttpExecutor;
|
||||
24
mc_test/node_modules/builder-util/out/nodeHttpExecutor.js
generated
vendored
Executable file
24
mc_test/node_modules/builder-util/out/nodeHttpExecutor.js
generated
vendored
Executable file
@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.httpExecutor = exports.NodeHttpExecutor = void 0;
|
||||
const builder_util_runtime_1 = require("builder-util-runtime");
|
||||
const http_1 = require("http");
|
||||
const http_proxy_agent_1 = require("http-proxy-agent");
|
||||
const https = require("https");
|
||||
const https_proxy_agent_1 = require("https-proxy-agent");
|
||||
class NodeHttpExecutor extends builder_util_runtime_1.HttpExecutor {
|
||||
// noinspection JSMethodCanBeStatic
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
createRequest(options, callback) {
|
||||
if (process.env["https_proxy"] !== undefined && options.protocol === "https:") {
|
||||
options.agent = new https_proxy_agent_1.HttpsProxyAgent(process.env["https_proxy"]);
|
||||
}
|
||||
else if (process.env["http_proxy"] !== undefined && options.protocol === "http:") {
|
||||
options.agent = new http_proxy_agent_1.HttpProxyAgent(process.env["http_proxy"]);
|
||||
}
|
||||
return (options.protocol === "http:" ? http_1.request : https.request)(options, callback);
|
||||
}
|
||||
}
|
||||
exports.NodeHttpExecutor = NodeHttpExecutor;
|
||||
exports.httpExecutor = new NodeHttpExecutor();
|
||||
//# sourceMappingURL=nodeHttpExecutor.js.map
|
||||
1
mc_test/node_modules/builder-util/out/nodeHttpExecutor.js.map
generated
vendored
Executable file
1
mc_test/node_modules/builder-util/out/nodeHttpExecutor.js.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"nodeHttpExecutor.js","sourceRoot":"","sources":["../src/nodeHttpExecutor.ts"],"names":[],"mappings":";;;AAAA,+DAAmD;AACnD,+BAA4D;AAC5D,uDAAiD;AACjD,+BAA8B;AAC9B,yDAAmD;AAEnD,MAAa,gBAAiB,SAAQ,mCAA2B;IAC/D,mCAAmC;IACnC,qCAAqC;IACrC,aAAa,CAAC,OAAY,EAAE,QAAiC;QAC3D,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,SAAS,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC9E,OAAO,CAAC,KAAK,GAAG,IAAI,mCAAe,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAA;QACjE,CAAC;aAAM,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,SAAS,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;YACnF,OAAO,CAAC,KAAK,GAAG,IAAI,iCAAc,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAA;QAC/D,CAAC;QACD,OAAO,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,cAAW,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IACxF,CAAC;CACF;AAXD,4CAWC;AAEY,QAAA,YAAY,GAAG,IAAI,gBAAgB,EAAE,CAAA","sourcesContent":["import { HttpExecutor } from \"builder-util-runtime\"\nimport { ClientRequest, request as httpRequest } from \"http\"\nimport { HttpProxyAgent } from \"http-proxy-agent\"\nimport * as https from \"https\"\nimport { HttpsProxyAgent } from \"https-proxy-agent\"\n\nexport class NodeHttpExecutor extends HttpExecutor<ClientRequest> {\n // noinspection JSMethodCanBeStatic\n // noinspection JSUnusedGlobalSymbols\n createRequest(options: any, callback: (response: any) => void): ClientRequest {\n if (process.env[\"https_proxy\"] !== undefined && options.protocol === \"https:\") {\n options.agent = new HttpsProxyAgent(process.env[\"https_proxy\"])\n } else if (process.env[\"http_proxy\"] !== undefined && options.protocol === \"http:\") {\n options.agent = new HttpProxyAgent(process.env[\"http_proxy\"])\n }\n return (options.protocol === \"http:\" ? httpRequest : https.request)(options, callback)\n }\n}\n\nexport const httpExecutor = new NodeHttpExecutor()\n"]}
|
||||
7
mc_test/node_modules/builder-util/out/promise.d.ts
generated
vendored
Executable file
7
mc_test/node_modules/builder-util/out/promise.d.ts
generated
vendored
Executable file
@ -0,0 +1,7 @@
|
||||
export declare function printErrorAndExit(error: Error): void;
|
||||
export declare function executeFinally<T>(promise: Promise<T>, task: (isErrorOccurred: boolean) => Promise<any>): Promise<T>;
|
||||
export declare class NestedError extends Error {
|
||||
constructor(errors: Array<Error>, message?: string);
|
||||
}
|
||||
export declare function orNullIfFileNotExist<T>(promise: Promise<T>): Promise<T | null>;
|
||||
export declare function orIfFileNotExist<T>(promise: Promise<T>, fallbackValue: T): Promise<T>;
|
||||
54
mc_test/node_modules/builder-util/out/promise.js
generated
vendored
Executable file
54
mc_test/node_modules/builder-util/out/promise.js
generated
vendored
Executable file
@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.orIfFileNotExist = exports.orNullIfFileNotExist = exports.NestedError = exports.executeFinally = exports.printErrorAndExit = void 0;
|
||||
const chalk = require("chalk");
|
||||
function printErrorAndExit(error) {
|
||||
console.error(chalk.red((error.stack || error).toString()));
|
||||
process.exit(1);
|
||||
}
|
||||
exports.printErrorAndExit = printErrorAndExit;
|
||||
// you don't need to handle error in your task - it is passed only indicate status of promise
|
||||
async function executeFinally(promise, task) {
|
||||
let result = null;
|
||||
try {
|
||||
result = await promise;
|
||||
}
|
||||
catch (originalError) {
|
||||
try {
|
||||
await task(true);
|
||||
}
|
||||
catch (taskError) {
|
||||
throw new NestedError([originalError, taskError]);
|
||||
}
|
||||
throw originalError;
|
||||
}
|
||||
await task(false);
|
||||
return result;
|
||||
}
|
||||
exports.executeFinally = executeFinally;
|
||||
class NestedError extends Error {
|
||||
constructor(errors, message = "Compound error: ") {
|
||||
let m = message;
|
||||
let i = 1;
|
||||
for (const error of errors) {
|
||||
const prefix = `Error #${i++} `;
|
||||
m += `\n\n${prefix}${"-".repeat(80)}\n${error.stack}`;
|
||||
}
|
||||
super(m);
|
||||
}
|
||||
}
|
||||
exports.NestedError = NestedError;
|
||||
function orNullIfFileNotExist(promise) {
|
||||
return orIfFileNotExist(promise, null);
|
||||
}
|
||||
exports.orNullIfFileNotExist = orNullIfFileNotExist;
|
||||
function orIfFileNotExist(promise, fallbackValue) {
|
||||
return promise.catch((e) => {
|
||||
if (e.code === "ENOENT" || e.code === "ENOTDIR") {
|
||||
return fallbackValue;
|
||||
}
|
||||
throw e;
|
||||
});
|
||||
}
|
||||
exports.orIfFileNotExist = orIfFileNotExist;
|
||||
//# sourceMappingURL=promise.js.map
|
||||
1
mc_test/node_modules/builder-util/out/promise.js.map
generated
vendored
Executable file
1
mc_test/node_modules/builder-util/out/promise.js.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"promise.js","sourceRoot":"","sources":["../src/promise.ts"],"names":[],"mappings":";;;AAAA,+BAA8B;AAE9B,SAAgB,iBAAiB,CAAC,KAAY;IAC5C,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;IAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC;AAHD,8CAGC;AAED,6FAA6F;AACtF,KAAK,UAAU,cAAc,CAAI,OAAmB,EAAE,IAAgD;IAC3G,IAAI,MAAM,GAAa,IAAI,CAAA;IAC3B,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,OAAO,CAAA;IACxB,CAAC;IAAC,OAAO,aAAkB,EAAE,CAAC;QAC5B,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,IAAI,CAAC,CAAA;QAClB,CAAC;QAAC,OAAO,SAAc,EAAE,CAAC;YACxB,MAAM,IAAI,WAAW,CAAC,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC,CAAA;QACnD,CAAC;QAED,MAAM,aAAa,CAAA;IACrB,CAAC;IAED,MAAM,IAAI,CAAC,KAAK,CAAC,CAAA;IACjB,OAAO,MAAM,CAAA;AACf,CAAC;AAhBD,wCAgBC;AAED,MAAa,WAAY,SAAQ,KAAK;IACpC,YAAY,MAAoB,EAAE,OAAO,GAAG,kBAAkB;QAC5D,IAAI,CAAC,GAAG,OAAO,CAAA;QACf,IAAI,CAAC,GAAG,CAAC,CAAA;QACT,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,MAAM,MAAM,GAAG,UAAU,CAAC,EAAE,GAAG,CAAA;YAC/B,CAAC,IAAI,OAAO,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,KAAK,CAAC,KAAK,EAAE,CAAA;QACvD,CAAC;QACD,KAAK,CAAC,CAAC,CAAC,CAAA;IACV,CAAC;CACF;AAVD,kCAUC;AAED,SAAgB,oBAAoB,CAAI,OAAmB;IACzD,OAAO,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACxC,CAAC;AAFD,oDAEC;AAED,SAAgB,gBAAgB,CAAI,OAAmB,EAAE,aAAgB;IACvE,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,CAAM,EAAE,EAAE;QAC9B,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAChD,OAAO,aAAa,CAAA;QACtB,CAAC;QACD,MAAM,CAAC,CAAA;IACT,CAAC,CAAC,CAAA;AACJ,CAAC;AAPD,4CAOC","sourcesContent":["import * as chalk from \"chalk\"\n\nexport function printErrorAndExit(error: Error) {\n console.error(chalk.red((error.stack || error).toString()))\n process.exit(1)\n}\n\n// you don't need to handle error in your task - it is passed only indicate status of promise\nexport async function executeFinally<T>(promise: Promise<T>, task: (isErrorOccurred: boolean) => Promise<any>): Promise<T> {\n let result: T | null = null\n try {\n result = await promise\n } catch (originalError: any) {\n try {\n await task(true)\n } catch (taskError: any) {\n throw new NestedError([originalError, taskError])\n }\n\n throw originalError\n }\n\n await task(false)\n return result\n}\n\nexport class NestedError extends Error {\n constructor(errors: Array<Error>, message = \"Compound error: \") {\n let m = message\n let i = 1\n for (const error of errors) {\n const prefix = `Error #${i++} `\n m += `\\n\\n${prefix}${\"-\".repeat(80)}\\n${error.stack}`\n }\n super(m)\n }\n}\n\nexport function orNullIfFileNotExist<T>(promise: Promise<T>): Promise<T | null> {\n return orIfFileNotExist(promise, null)\n}\n\nexport function orIfFileNotExist<T>(promise: Promise<T>, fallbackValue: T): Promise<T> {\n return promise.catch((e: any) => {\n if (e.code === \"ENOENT\" || e.code === \"ENOTDIR\") {\n return fallbackValue\n }\n throw e\n })\n}\n"]}
|
||||
42
mc_test/node_modules/builder-util/out/util.d.ts
generated
vendored
Executable file
42
mc_test/node_modules/builder-util/out/util.d.ts
generated
vendored
Executable file
@ -0,0 +1,42 @@
|
||||
/// <reference types="node" />
|
||||
import { ChildProcess, ExecFileOptions, SpawnOptions } from "child_process";
|
||||
import _debug from "debug";
|
||||
export { safeStringifyJson } from "builder-util-runtime";
|
||||
export { TmpDir } from "temp-file";
|
||||
export { log, debug } from "./log";
|
||||
export { Arch, getArchCliNames, toLinuxArchString, getArchSuffix, ArchType, archFromString, defaultArchFromString } from "./arch";
|
||||
export { AsyncTaskManager } from "./asyncTaskManager";
|
||||
export { DebugLogger } from "./DebugLogger";
|
||||
export { copyFile, exists } from "./fs";
|
||||
export { asArray } from "builder-util-runtime";
|
||||
export { deepAssign } from "./deepAssign";
|
||||
export { getPath7za, getPath7x } from "./7za";
|
||||
export declare const debug7z: _debug.Debugger;
|
||||
export declare function serializeToYaml(object: any, skipInvalid?: boolean, noRefs?: boolean): string;
|
||||
export declare function removePassword(input: string): string;
|
||||
export declare function exec(file: string, args?: Array<string> | null, options?: ExecFileOptions, isLogOutIfDebug?: boolean): Promise<string>;
|
||||
export interface ExtraSpawnOptions {
|
||||
isPipeInput?: boolean;
|
||||
}
|
||||
export declare function doSpawn(command: string, args: Array<string>, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): ChildProcess;
|
||||
export declare function spawnAndWrite(command: string, args: Array<string>, data: string, options?: SpawnOptions): Promise<any>;
|
||||
export declare function spawn(command: string, args?: Array<string> | null, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise<any>;
|
||||
export declare class ExecError extends Error {
|
||||
readonly exitCode: number;
|
||||
alreadyLogged: boolean;
|
||||
constructor(command: string, exitCode: number, out: string, errorOut: string, code?: string);
|
||||
}
|
||||
type Nullish = null | undefined;
|
||||
export declare function use<T, R>(value: T | Nullish, task: (value: T) => R): R | null;
|
||||
export declare function isEmptyOrSpaces(s: string | null | undefined): s is "" | null | undefined;
|
||||
export declare function isTokenCharValid(token: string): boolean;
|
||||
export declare function addValue<K, T>(map: Map<K, Array<T>>, key: K, value: T): void;
|
||||
export declare function replaceDefault(inList: Array<string> | null | undefined, defaultList: Array<string>): Array<string>;
|
||||
export declare function getPlatformIconFileName(value: string | null | undefined, isMac: boolean): string | null | undefined;
|
||||
export declare function isPullRequest(): boolean | "" | undefined;
|
||||
export declare function isEnvTrue(value: string | null | undefined): boolean;
|
||||
export declare class InvalidConfigurationError extends Error {
|
||||
constructor(message: string, code?: string);
|
||||
}
|
||||
export declare function executeAppBuilder(args: Array<string>, childProcessConsumer?: (childProcess: ChildProcess) => void, extraOptions?: SpawnOptions, maxRetries?: number): Promise<string>;
|
||||
export declare function retry<T>(task: () => Promise<T>, retriesLeft: number, interval: number, backoff?: number, attempt?: number): Promise<T>;
|
||||
388
mc_test/node_modules/builder-util/out/util.js
generated
vendored
Executable file
388
mc_test/node_modules/builder-util/out/util.js
generated
vendored
Executable file
@ -0,0 +1,388 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.retry = exports.executeAppBuilder = exports.InvalidConfigurationError = exports.isEnvTrue = exports.isPullRequest = exports.getPlatformIconFileName = exports.replaceDefault = exports.addValue = exports.isTokenCharValid = exports.isEmptyOrSpaces = exports.use = exports.ExecError = exports.spawn = exports.spawnAndWrite = exports.doSpawn = exports.exec = exports.removePassword = exports.serializeToYaml = exports.debug7z = exports.getPath7x = exports.getPath7za = exports.deepAssign = exports.asArray = exports.exists = exports.copyFile = exports.DebugLogger = exports.AsyncTaskManager = exports.defaultArchFromString = exports.archFromString = exports.getArchSuffix = exports.toLinuxArchString = exports.getArchCliNames = exports.Arch = exports.debug = exports.log = exports.TmpDir = exports.safeStringifyJson = void 0;
|
||||
const app_builder_bin_1 = require("app-builder-bin");
|
||||
const builder_util_runtime_1 = require("builder-util-runtime");
|
||||
const chalk = require("chalk");
|
||||
const child_process_1 = require("child_process");
|
||||
const cross_spawn_1 = require("cross-spawn");
|
||||
const crypto_1 = require("crypto");
|
||||
const debug_1 = require("debug");
|
||||
const js_yaml_1 = require("js-yaml");
|
||||
const path = require("path");
|
||||
const log_1 = require("./log");
|
||||
const source_map_support_1 = require("source-map-support");
|
||||
const _7za_1 = require("./7za");
|
||||
if (process.env.JEST_WORKER_ID == null) {
|
||||
(0, source_map_support_1.install)();
|
||||
}
|
||||
var builder_util_runtime_2 = require("builder-util-runtime");
|
||||
Object.defineProperty(exports, "safeStringifyJson", { enumerable: true, get: function () { return builder_util_runtime_2.safeStringifyJson; } });
|
||||
var temp_file_1 = require("temp-file");
|
||||
Object.defineProperty(exports, "TmpDir", { enumerable: true, get: function () { return temp_file_1.TmpDir; } });
|
||||
var log_2 = require("./log");
|
||||
Object.defineProperty(exports, "log", { enumerable: true, get: function () { return log_2.log; } });
|
||||
Object.defineProperty(exports, "debug", { enumerable: true, get: function () { return log_2.debug; } });
|
||||
var arch_1 = require("./arch");
|
||||
Object.defineProperty(exports, "Arch", { enumerable: true, get: function () { return arch_1.Arch; } });
|
||||
Object.defineProperty(exports, "getArchCliNames", { enumerable: true, get: function () { return arch_1.getArchCliNames; } });
|
||||
Object.defineProperty(exports, "toLinuxArchString", { enumerable: true, get: function () { return arch_1.toLinuxArchString; } });
|
||||
Object.defineProperty(exports, "getArchSuffix", { enumerable: true, get: function () { return arch_1.getArchSuffix; } });
|
||||
Object.defineProperty(exports, "archFromString", { enumerable: true, get: function () { return arch_1.archFromString; } });
|
||||
Object.defineProperty(exports, "defaultArchFromString", { enumerable: true, get: function () { return arch_1.defaultArchFromString; } });
|
||||
var asyncTaskManager_1 = require("./asyncTaskManager");
|
||||
Object.defineProperty(exports, "AsyncTaskManager", { enumerable: true, get: function () { return asyncTaskManager_1.AsyncTaskManager; } });
|
||||
var DebugLogger_1 = require("./DebugLogger");
|
||||
Object.defineProperty(exports, "DebugLogger", { enumerable: true, get: function () { return DebugLogger_1.DebugLogger; } });
|
||||
var fs_1 = require("./fs");
|
||||
Object.defineProperty(exports, "copyFile", { enumerable: true, get: function () { return fs_1.copyFile; } });
|
||||
Object.defineProperty(exports, "exists", { enumerable: true, get: function () { return fs_1.exists; } });
|
||||
var builder_util_runtime_3 = require("builder-util-runtime");
|
||||
Object.defineProperty(exports, "asArray", { enumerable: true, get: function () { return builder_util_runtime_3.asArray; } });
|
||||
var deepAssign_1 = require("./deepAssign");
|
||||
Object.defineProperty(exports, "deepAssign", { enumerable: true, get: function () { return deepAssign_1.deepAssign; } });
|
||||
var _7za_2 = require("./7za");
|
||||
Object.defineProperty(exports, "getPath7za", { enumerable: true, get: function () { return _7za_2.getPath7za; } });
|
||||
Object.defineProperty(exports, "getPath7x", { enumerable: true, get: function () { return _7za_2.getPath7x; } });
|
||||
exports.debug7z = (0, debug_1.default)("electron-builder:7z");
|
||||
function serializeToYaml(object, skipInvalid = false, noRefs = false) {
|
||||
return (0, js_yaml_1.dump)(object, {
|
||||
lineWidth: 8000,
|
||||
skipInvalid,
|
||||
noRefs,
|
||||
});
|
||||
}
|
||||
exports.serializeToYaml = serializeToYaml;
|
||||
function removePassword(input) {
|
||||
return input.replace(/(-String |-P |pass:| \/p |-pass |--secretKey |--accessKey |-p )([^ ]+)/g, (match, p1, p2) => {
|
||||
if (p1.trim() === "/p" && p2.startsWith("\\\\Mac\\Host\\\\")) {
|
||||
// appx /p
|
||||
return `${p1}${p2}`;
|
||||
}
|
||||
return `${p1}${(0, crypto_1.createHash)("sha256").update(p2).digest("hex")} (sha256 hash)`;
|
||||
});
|
||||
}
|
||||
exports.removePassword = removePassword;
|
||||
function getProcessEnv(env) {
|
||||
if (process.platform === "win32") {
|
||||
return env == null ? undefined : env;
|
||||
}
|
||||
const finalEnv = {
|
||||
...(env || process.env),
|
||||
};
|
||||
// without LC_CTYPE dpkg can returns encoded unicode symbols
|
||||
// set LC_CTYPE to avoid crash https://github.com/electron-userland/electron-builder/issues/503 Even "en_DE.UTF-8" leads to error.
|
||||
const locale = process.platform === "linux" ? process.env.LANG || "C.UTF-8" : "en_US.UTF-8";
|
||||
finalEnv.LANG = locale;
|
||||
finalEnv.LC_CTYPE = locale;
|
||||
finalEnv.LC_ALL = locale;
|
||||
return finalEnv;
|
||||
}
|
||||
function exec(file, args, options, isLogOutIfDebug = true) {
|
||||
if (log_1.log.isDebugEnabled) {
|
||||
const logFields = {
|
||||
file,
|
||||
args: args == null ? "" : removePassword(args.join(" ")),
|
||||
};
|
||||
if (options != null) {
|
||||
if (options.cwd != null) {
|
||||
logFields.cwd = options.cwd;
|
||||
}
|
||||
if (options.env != null) {
|
||||
const diffEnv = { ...options.env };
|
||||
for (const name of Object.keys(process.env)) {
|
||||
if (process.env[name] === options.env[name]) {
|
||||
delete diffEnv[name];
|
||||
}
|
||||
}
|
||||
logFields.env = (0, builder_util_runtime_1.safeStringifyJson)(diffEnv);
|
||||
}
|
||||
}
|
||||
log_1.log.debug(logFields, "executing");
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
(0, child_process_1.execFile)(file, args, {
|
||||
...options,
|
||||
maxBuffer: 1000 * 1024 * 1024,
|
||||
env: getProcessEnv(options == null ? null : options.env),
|
||||
}, (error, stdout, stderr) => {
|
||||
if (error == null) {
|
||||
if (isLogOutIfDebug && log_1.log.isDebugEnabled) {
|
||||
const logFields = {
|
||||
file,
|
||||
};
|
||||
if (stdout.length > 0) {
|
||||
logFields.stdout = stdout;
|
||||
}
|
||||
if (stderr.length > 0) {
|
||||
logFields.stderr = stderr;
|
||||
}
|
||||
log_1.log.debug(logFields, "executed");
|
||||
}
|
||||
resolve(stdout.toString());
|
||||
}
|
||||
else {
|
||||
let message = chalk.red(removePassword(`Exit code: ${error.code}. ${error.message}`));
|
||||
if (stdout.length !== 0) {
|
||||
if (file.endsWith("wine")) {
|
||||
stdout = stdout.toString();
|
||||
}
|
||||
message += `\n${chalk.yellow(stdout.toString())}`;
|
||||
}
|
||||
if (stderr.length !== 0) {
|
||||
if (file.endsWith("wine")) {
|
||||
stderr = stderr.toString();
|
||||
}
|
||||
message += `\n${chalk.red(stderr.toString())}`;
|
||||
}
|
||||
reject(new Error(message));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
exports.exec = exec;
|
||||
function logSpawn(command, args, options) {
|
||||
// use general debug.enabled to log spawn, because it doesn't produce a lot of output (the only line), but important in any case
|
||||
if (!log_1.log.isDebugEnabled) {
|
||||
return;
|
||||
}
|
||||
const argsString = removePassword(args.join(" "));
|
||||
const logFields = {
|
||||
command: command + " " + (command === "docker" ? argsString : removePassword(argsString)),
|
||||
};
|
||||
if (options != null && options.cwd != null) {
|
||||
logFields.cwd = options.cwd;
|
||||
}
|
||||
log_1.log.debug(logFields, "spawning");
|
||||
}
|
||||
function doSpawn(command, args, options, extraOptions) {
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
options.env = getProcessEnv(options.env);
|
||||
if (options.stdio == null) {
|
||||
const isDebugEnabled = log_1.debug.enabled;
|
||||
// do not ignore stdout/stderr if not debug, because in this case we will read into buffer and print on error
|
||||
options.stdio = [extraOptions != null && extraOptions.isPipeInput ? "pipe" : "ignore", isDebugEnabled ? "inherit" : "pipe", isDebugEnabled ? "inherit" : "pipe"];
|
||||
}
|
||||
logSpawn(command, args, options);
|
||||
try {
|
||||
return (0, cross_spawn_1.spawn)(command, args, options);
|
||||
}
|
||||
catch (e) {
|
||||
throw new Error(`Cannot spawn ${command}: ${e.stack || e}`);
|
||||
}
|
||||
}
|
||||
exports.doSpawn = doSpawn;
|
||||
function spawnAndWrite(command, args, data, options) {
|
||||
const childProcess = doSpawn(command, args, options, { isPipeInput: true });
|
||||
const timeout = setTimeout(() => childProcess.kill(), 4 * 60 * 1000);
|
||||
return new Promise((resolve, reject) => {
|
||||
handleProcess("close", childProcess, command, () => {
|
||||
try {
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
finally {
|
||||
resolve(undefined);
|
||||
}
|
||||
}, error => {
|
||||
try {
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
finally {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
childProcess.stdin.end(data);
|
||||
});
|
||||
}
|
||||
exports.spawnAndWrite = spawnAndWrite;
|
||||
function spawn(command, args, options, extraOptions) {
|
||||
return new Promise((resolve, reject) => {
|
||||
handleProcess("close", doSpawn(command, args || [], options, extraOptions), command, resolve, reject);
|
||||
});
|
||||
}
|
||||
exports.spawn = spawn;
|
||||
function handleProcess(event, childProcess, command, resolve, reject) {
|
||||
childProcess.on("error", reject);
|
||||
let out = "";
|
||||
if (childProcess.stdout != null) {
|
||||
childProcess.stdout.on("data", (data) => {
|
||||
out += data;
|
||||
});
|
||||
}
|
||||
let errorOut = "";
|
||||
if (childProcess.stderr != null) {
|
||||
childProcess.stderr.on("data", (data) => {
|
||||
errorOut += data;
|
||||
});
|
||||
}
|
||||
childProcess.once(event, (code) => {
|
||||
if (log_1.log.isDebugEnabled) {
|
||||
const fields = {
|
||||
command: path.basename(command),
|
||||
code,
|
||||
pid: childProcess.pid,
|
||||
};
|
||||
if (out.length > 0) {
|
||||
fields.out = out;
|
||||
}
|
||||
log_1.log.debug(fields, "exited");
|
||||
}
|
||||
if (code === 0) {
|
||||
if (resolve != null) {
|
||||
resolve(out);
|
||||
}
|
||||
}
|
||||
else {
|
||||
reject(new ExecError(command, code, out, errorOut));
|
||||
}
|
||||
});
|
||||
}
|
||||
function formatOut(text, title) {
|
||||
return text.length === 0 ? "" : `\n${title}:\n${text}`;
|
||||
}
|
||||
class ExecError extends Error {
|
||||
constructor(command, exitCode, out, errorOut, code = "ERR_ELECTRON_BUILDER_CANNOT_EXECUTE") {
|
||||
super(`${command} process failed ${code}${formatOut(String(exitCode), "Exit code")}${formatOut(out, "Output")}${formatOut(errorOut, "Error output")}`);
|
||||
this.exitCode = exitCode;
|
||||
this.alreadyLogged = false;
|
||||
this.code = code;
|
||||
}
|
||||
}
|
||||
exports.ExecError = ExecError;
|
||||
function use(value, task) {
|
||||
return value == null ? null : task(value);
|
||||
}
|
||||
exports.use = use;
|
||||
function isEmptyOrSpaces(s) {
|
||||
return s == null || s.trim().length === 0;
|
||||
}
|
||||
exports.isEmptyOrSpaces = isEmptyOrSpaces;
|
||||
function isTokenCharValid(token) {
|
||||
return /^[.\w/=+-]+$/.test(token);
|
||||
}
|
||||
exports.isTokenCharValid = isTokenCharValid;
|
||||
function addValue(map, key, value) {
|
||||
const list = map.get(key);
|
||||
if (list == null) {
|
||||
map.set(key, [value]);
|
||||
}
|
||||
else if (!list.includes(value)) {
|
||||
list.push(value);
|
||||
}
|
||||
}
|
||||
exports.addValue = addValue;
|
||||
function replaceDefault(inList, defaultList) {
|
||||
if (inList == null || (inList.length === 1 && inList[0] === "default")) {
|
||||
return defaultList;
|
||||
}
|
||||
const index = inList.indexOf("default");
|
||||
if (index >= 0) {
|
||||
const list = inList.slice(0, index);
|
||||
list.push(...defaultList);
|
||||
if (index !== inList.length - 1) {
|
||||
list.push(...inList.slice(index + 1));
|
||||
}
|
||||
inList = list;
|
||||
}
|
||||
return inList;
|
||||
}
|
||||
exports.replaceDefault = replaceDefault;
|
||||
function getPlatformIconFileName(value, isMac) {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
if (!value.includes(".")) {
|
||||
return `${value}.${isMac ? "icns" : "ico"}`;
|
||||
}
|
||||
return value.replace(isMac ? ".ico" : ".icns", isMac ? ".icns" : ".ico");
|
||||
}
|
||||
exports.getPlatformIconFileName = getPlatformIconFileName;
|
||||
function isPullRequest() {
|
||||
// TRAVIS_PULL_REQUEST is set to the pull request number if the current job is a pull request build, or false if it’s not.
|
||||
function isSet(value) {
|
||||
// value can be or null, or empty string
|
||||
return value && value !== "false";
|
||||
}
|
||||
return (isSet(process.env.TRAVIS_PULL_REQUEST) ||
|
||||
isSet(process.env.CIRCLE_PULL_REQUEST) ||
|
||||
isSet(process.env.BITRISE_PULL_REQUEST) ||
|
||||
isSet(process.env.APPVEYOR_PULL_REQUEST_NUMBER) ||
|
||||
isSet(process.env.GITHUB_BASE_REF));
|
||||
}
|
||||
exports.isPullRequest = isPullRequest;
|
||||
function isEnvTrue(value) {
|
||||
if (value != null) {
|
||||
value = value.trim();
|
||||
}
|
||||
return value === "true" || value === "" || value === "1";
|
||||
}
|
||||
exports.isEnvTrue = isEnvTrue;
|
||||
class InvalidConfigurationError extends Error {
|
||||
constructor(message, code = "ERR_ELECTRON_BUILDER_INVALID_CONFIGURATION") {
|
||||
super(message);
|
||||
this.code = code;
|
||||
}
|
||||
}
|
||||
exports.InvalidConfigurationError = InvalidConfigurationError;
|
||||
async function executeAppBuilder(args, childProcessConsumer, extraOptions = {}, maxRetries = 0) {
|
||||
const command = app_builder_bin_1.appBuilderPath;
|
||||
const env = {
|
||||
...process.env,
|
||||
SZA_PATH: await (0, _7za_1.getPath7za)(),
|
||||
FORCE_COLOR: chalk.level === 0 ? "0" : "1",
|
||||
};
|
||||
const cacheEnv = process.env.ELECTRON_BUILDER_CACHE;
|
||||
if (cacheEnv != null && cacheEnv.length > 0) {
|
||||
env.ELECTRON_BUILDER_CACHE = path.resolve(cacheEnv);
|
||||
}
|
||||
if (extraOptions.env != null) {
|
||||
Object.assign(env, extraOptions.env);
|
||||
}
|
||||
function runCommand() {
|
||||
return new Promise((resolve, reject) => {
|
||||
const childProcess = doSpawn(command, args, {
|
||||
stdio: ["ignore", "pipe", process.stdout],
|
||||
...extraOptions,
|
||||
env,
|
||||
});
|
||||
if (childProcessConsumer != null) {
|
||||
childProcessConsumer(childProcess);
|
||||
}
|
||||
handleProcess("close", childProcess, command, resolve, error => {
|
||||
if (error instanceof ExecError && error.exitCode === 2) {
|
||||
error.alreadyLogged = true;
|
||||
}
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
if (maxRetries === 0) {
|
||||
return runCommand();
|
||||
}
|
||||
else {
|
||||
return retry(runCommand, maxRetries, 1000);
|
||||
}
|
||||
}
|
||||
exports.executeAppBuilder = executeAppBuilder;
|
||||
async function retry(task, retriesLeft, interval, backoff = 0, attempt = 0) {
|
||||
try {
|
||||
return await task();
|
||||
}
|
||||
catch (error) {
|
||||
log_1.log.info(`Above command failed, retrying ${retriesLeft} more times`);
|
||||
if (retriesLeft > 0) {
|
||||
await new Promise(resolve => setTimeout(resolve, interval + backoff * attempt));
|
||||
return await retry(task, retriesLeft - 1, interval, backoff, attempt + 1);
|
||||
}
|
||||
else {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.retry = retry;
|
||||
//# sourceMappingURL=util.js.map
|
||||
1
mc_test/node_modules/builder-util/out/util.js.map
generated
vendored
Executable file
1
mc_test/node_modules/builder-util/out/util.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user