Add: node_modules
This commit is contained in:
		
							
								
								
									
										7
									
								
								app/node_modules/builder-util/out/DebugLogger.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								app/node_modules/builder-util/out/DebugLogger.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal 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>;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										76
									
								
								app/node_modules/builder-util/out/DebugLogger.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								app/node_modules/builder-util/out/DebugLogger.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,76 @@
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
Object.defineProperty(exports, "__esModule", {
 | 
			
		||||
  value: true
 | 
			
		||||
});
 | 
			
		||||
exports.DebugLogger = void 0;
 | 
			
		||||
 | 
			
		||||
function _fsExtra() {
 | 
			
		||||
  const data = require("fs-extra");
 | 
			
		||||
 | 
			
		||||
  _fsExtra = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _util() {
 | 
			
		||||
  const data = require("./util");
 | 
			
		||||
 | 
			
		||||
  _util = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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].push(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, _fsExtra().outputFile)(file, (0, _util().serializeToYaml)(this.data));
 | 
			
		||||
    } else {
 | 
			
		||||
      return Promise.resolve();
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
} exports.DebugLogger = DebugLogger;
 | 
			
		||||
// __ts-babel@6.0.4
 | 
			
		||||
//# sourceMappingURL=DebugLogger.js.map
 | 
			
		||||
							
								
								
									
										1
									
								
								app/node_modules/builder-util/out/DebugLogger.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								app/node_modules/builder-util/out/DebugLogger.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
{"version":3,"sources":["../src/DebugLogger.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEM,MAAO,WAAP,CAAkB;AAGtB,EAAA,WAAA,CAAqB,SAAA,GAAY,IAAjC,EAAqC;AAAhB,SAAA,SAAA,GAAA,SAAA;AAFZ,SAAA,IAAA,GAAY,EAAZ;AAGR;;AAED,EAAA,GAAG,CAAC,GAAD,EAAc,KAAd,EAAwB;AACzB,QAAI,CAAC,KAAK,SAAV,EAAqB;AACnB;AACD;;AAED,UAAM,QAAQ,GAAG,GAAG,CAAC,KAAJ,CAAU,GAAV,CAAjB;AACA,QAAI,CAAC,GAAG,KAAK,IAAb;AACA,QAAI,QAAQ,GAAkB,IAA9B;;AACA,SAAK,MAAM,CAAX,IAAgB,QAAhB,EAA0B;AACxB,UAAI,CAAC,KAAK,QAAQ,CAAC,QAAQ,CAAC,MAAT,GAAkB,CAAnB,CAAlB,EAAyC;AACvC,QAAA,QAAQ,GAAG,CAAX;AACA;AACD,OAHD,MAIK;AACH,YAAI,CAAC,CAAC,CAAD,CAAD,IAAQ,IAAZ,EAAkB;AAChB,UAAA,CAAC,CAAC,CAAD,CAAD,GAAO,MAAM,CAAC,MAAP,CAAc,IAAd,CAAP;AACD,SAFD,MAGK,IAAI,OAAO,CAAC,CAAC,CAAD,CAAR,KAAgB,QAApB,EAA8B;AACjC,UAAA,CAAC,CAAC,CAAD,CAAD,GAAO,CAAC,CAAC,CAAC,CAAD,CAAF,CAAP;AACD;;AACD,QAAA,CAAC,GAAG,CAAC,CAAC,CAAD,CAAL;AACD;AACF;;AAED,QAAI,KAAK,CAAC,OAAN,CAAc,CAAC,CAAC,QAAD,CAAf,CAAJ,EAAkC;AAChC,MAAA,CAAC,CAAC,QAAD,CAAD,CAAc,IAAd,CAAmB,KAAnB;AACD,KAFD,MAGK;AACH,MAAA,CAAC,CAAC,QAAD,CAAD,GAAgB,KAAhB;AACD;AACF;;AAED,EAAA,IAAI,CAAC,IAAD,EAAa;AACf;AACA,QAAI,KAAK,SAAL,IAAkB,MAAM,CAAC,IAAP,CAAY,KAAK,IAAjB,EAAuB,MAAvB,GAAgC,CAAtD,EAAyD;AACvD,aAAO,2BAAW,IAAX,EAAiB,6BAAgB,KAAK,IAArB,CAAjB,CAAP;AACD,KAFD,MAGK;AACH,aAAO,OAAO,CAAC,OAAR,EAAP;AACD;AACF;;AA9CqB,C","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\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      }\n      else {\n        if (o[p] == null) {\n          o[p] = Object.create(null)\n        }\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!!].push(value)\n    }\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    }\n    else {\n      return Promise.resolve()\n    }\n  }\n}"],"sourceRoot":""}
 | 
			
		||||
							
								
								
									
										12
									
								
								app/node_modules/builder-util/out/arch.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								app/node_modules/builder-util/out/arch.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
export declare enum Arch {
 | 
			
		||||
    ia32 = 0,
 | 
			
		||||
    x64 = 1,
 | 
			
		||||
    armv7l = 2,
 | 
			
		||||
    arm64 = 3
 | 
			
		||||
}
 | 
			
		||||
export declare type ArchType = "x64" | "ia32" | "armv7l" | "arm64";
 | 
			
		||||
export declare function toLinuxArchString(arch: Arch, targetName: string): string;
 | 
			
		||||
export declare function getArchCliNames(): Array<string>;
 | 
			
		||||
export declare function getArchSuffix(arch: Arch): string;
 | 
			
		||||
export declare function archFromString(name: string): Arch;
 | 
			
		||||
export declare function getArtifactArchName(arch: Arch, ext: string): string;
 | 
			
		||||
							
								
								
									
										93
									
								
								app/node_modules/builder-util/out/arch.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										93
									
								
								app/node_modules/builder-util/out/arch.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,93 @@
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
Object.defineProperty(exports, "__esModule", {
 | 
			
		||||
  value: true
 | 
			
		||||
});
 | 
			
		||||
exports.toLinuxArchString = toLinuxArchString;
 | 
			
		||||
exports.getArchCliNames = getArchCliNames;
 | 
			
		||||
exports.getArchSuffix = getArchSuffix;
 | 
			
		||||
exports.archFromString = archFromString;
 | 
			
		||||
exports.getArtifactArchName = getArtifactArchName;
 | 
			
		||||
exports.Arch = void 0;
 | 
			
		||||
var Arch;
 | 
			
		||||
exports.Arch = Arch;
 | 
			
		||||
 | 
			
		||||
(function (Arch) {
 | 
			
		||||
  Arch[Arch["ia32"] = 0] = "ia32";
 | 
			
		||||
  Arch[Arch["x64"] = 1] = "x64";
 | 
			
		||||
  Arch[Arch["armv7l"] = 2] = "armv7l";
 | 
			
		||||
  Arch[Arch["arm64"] = 3] = "arm64";
 | 
			
		||||
})(Arch || (exports.Arch = Arch = {}));
 | 
			
		||||
 | 
			
		||||
function toLinuxArchString(arch, targetName) {
 | 
			
		||||
  switch (arch) {
 | 
			
		||||
    case Arch.x64:
 | 
			
		||||
      return "amd64";
 | 
			
		||||
 | 
			
		||||
    case Arch.ia32:
 | 
			
		||||
      return targetName === "pacman" ? "i686" : "i386";
 | 
			
		||||
 | 
			
		||||
    case Arch.armv7l:
 | 
			
		||||
      return targetName === "snap" || targetName === "deb" ? "armhf" : "armv7l";
 | 
			
		||||
 | 
			
		||||
    case Arch.arm64:
 | 
			
		||||
      return "arm64";
 | 
			
		||||
 | 
			
		||||
    default:
 | 
			
		||||
      throw new Error(`Unsupported arch ${arch}`);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function getArchCliNames() {
 | 
			
		||||
  return [Arch[Arch.ia32], Arch[Arch.x64], Arch[Arch.armv7l], Arch[Arch.arm64]];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function getArchSuffix(arch) {
 | 
			
		||||
  return arch === Arch.x64 ? "" : `-${Arch[arch]}`;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function archFromString(name) {
 | 
			
		||||
  switch (name) {
 | 
			
		||||
    case "x64":
 | 
			
		||||
      return Arch.x64;
 | 
			
		||||
 | 
			
		||||
    case "ia32":
 | 
			
		||||
      return Arch.ia32;
 | 
			
		||||
 | 
			
		||||
    case "arm64":
 | 
			
		||||
      return Arch.arm64;
 | 
			
		||||
 | 
			
		||||
    case "armv7l":
 | 
			
		||||
      return Arch.armv7l;
 | 
			
		||||
 | 
			
		||||
    default:
 | 
			
		||||
      throw new Error(`Unsupported arch ${name}`);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function getArtifactArchName(arch, ext) {
 | 
			
		||||
  let archName = Arch[arch];
 | 
			
		||||
  const isAppImage = ext === "AppImage" || ext === "appimage";
 | 
			
		||||
 | 
			
		||||
  if (arch === Arch.x64) {
 | 
			
		||||
    if (isAppImage || ext === "rpm") {
 | 
			
		||||
      archName = "x86_64";
 | 
			
		||||
    } else if (ext === "deb" || ext === "snap") {
 | 
			
		||||
      archName = "amd64";
 | 
			
		||||
    }
 | 
			
		||||
  } else if (arch === Arch.ia32) {
 | 
			
		||||
    if (ext === "deb" || isAppImage || ext === "snap") {
 | 
			
		||||
      archName = "i386";
 | 
			
		||||
    } else if (ext === "pacman" || ext === "rpm") {
 | 
			
		||||
      archName = "i686";
 | 
			
		||||
    }
 | 
			
		||||
  } else if (arch === Arch.armv7l) {
 | 
			
		||||
    if (ext === "snap") {
 | 
			
		||||
      archName = "armhf";
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return archName;
 | 
			
		||||
} 
 | 
			
		||||
// __ts-babel@6.0.4
 | 
			
		||||
//# sourceMappingURL=arch.js.map
 | 
			
		||||
							
								
								
									
										1
									
								
								app/node_modules/builder-util/out/arch.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								app/node_modules/builder-util/out/arch.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
{"version":3,"sources":["../src/arch.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,IAAY,IAAZ;;;AAAA,CAAA,UAAY,IAAZ,EAAgB;AACd,EAAA,IAAA,CAAA,IAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAA;AAAM,EAAA,IAAA,CAAA,IAAA,CAAA,KAAA,CAAA,GAAA,CAAA,CAAA,GAAA,KAAA;AAAK,EAAA,IAAA,CAAA,IAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAA;AAAQ,EAAA,IAAA,CAAA,IAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAA;AACpB,CAFD,EAAY,IAAI,oBAAJ,IAAI,GAAA,EAAA,CAAhB;;AAMM,SAAU,iBAAV,CAA4B,IAA5B,EAAwC,UAAxC,EAA0D;AAC9D,UAAQ,IAAR;AACE,SAAK,IAAI,CAAC,GAAV;AACE,aAAO,OAAP;;AACF,SAAK,IAAI,CAAC,IAAV;AACE,aAAO,UAAU,KAAK,QAAf,GAA0B,MAA1B,GAAmC,MAA1C;;AACF,SAAK,IAAI,CAAC,MAAV;AACE,aAAO,UAAU,KAAK,MAAf,IAAyB,UAAU,KAAK,KAAxC,GAAgD,OAAhD,GAA0D,QAAjE;;AACF,SAAK,IAAI,CAAC,KAAV;AACE,aAAO,OAAP;;AAEF;AACE,YAAM,IAAI,KAAJ,CAAU,oBAAoB,IAAI,EAAlC,CAAN;AAXJ;AAaD;;AAEK,SAAU,eAAV,GAAyB;AAC7B,SAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAN,CAAL,EAAkB,IAAI,CAAC,IAAI,CAAC,GAAN,CAAtB,EAAkC,IAAI,CAAC,IAAI,CAAC,MAAN,CAAtC,EAAqD,IAAI,CAAC,IAAI,CAAC,KAAN,CAAzD,CAAP;AACD;;AAEK,SAAU,aAAV,CAAwB,IAAxB,EAAkC;AACtC,SAAO,IAAI,KAAK,IAAI,CAAC,GAAd,GAAoB,EAApB,GAAyB,IAAI,IAAI,CAAC,IAAD,CAAM,EAA9C;AACD;;AAEK,SAAU,cAAV,CAAyB,IAAzB,EAAqC;AACzC,UAAQ,IAAR;AACE,SAAK,KAAL;AACE,aAAO,IAAI,CAAC,GAAZ;;AACF,SAAK,MAAL;AACE,aAAO,IAAI,CAAC,IAAZ;;AACF,SAAK,OAAL;AACE,aAAO,IAAI,CAAC,KAAZ;;AACF,SAAK,QAAL;AACE,aAAO,IAAI,CAAC,MAAZ;;AAEF;AACE,YAAM,IAAI,KAAJ,CAAU,oBAAoB,IAAI,EAAlC,CAAN;AAXJ;AAaD;;AAEK,SAAU,mBAAV,CAA8B,IAA9B,EAA0C,GAA1C,EAAqD;AACzD,MAAI,QAAQ,GAAG,IAAI,CAAC,IAAD,CAAnB;AACA,QAAM,UAAU,GAAG,GAAG,KAAK,UAAR,IAAsB,GAAG,KAAK,UAAjD;;AACA,MAAI,IAAI,KAAK,IAAI,CAAC,GAAlB,EAAuB;AACrB,QAAI,UAAU,IAAI,GAAG,KAAK,KAA1B,EAAiC;AAC/B,MAAA,QAAQ,GAAG,QAAX;AACD,KAFD,MAGK,IAAI,GAAG,KAAK,KAAR,IAAiB,GAAG,KAAK,MAA7B,EAAqC;AACxC,MAAA,QAAQ,GAAG,OAAX;AACD;AACF,GAPD,MAQK,IAAI,IAAI,KAAK,IAAI,CAAC,IAAlB,EAAwB;AAC3B,QAAI,GAAG,KAAK,KAAR,IAAiB,UAAjB,IAA+B,GAAG,KAAK,MAA3C,EAAmD;AACjD,MAAA,QAAQ,GAAG,MAAX;AACD,KAFD,MAGK,IAAI,GAAG,KAAK,QAAR,IAAoB,GAAG,KAAK,KAAhC,EAAuC;AAC1C,MAAA,QAAQ,GAAG,MAAX;AACD;AACF,GAPI,MAQA,IAAI,IAAI,KAAK,IAAI,CAAC,MAAlB,EAA0B;AAC7B,QAAI,GAAG,KAAK,MAAZ,EAAoB;AAClB,MAAA,QAAQ,GAAG,OAAX;AACD;AACF;;AACD,SAAO,QAAP;AACD,C","sourcesContent":["export enum Arch {\n  ia32, x64, armv7l, arm64\n}\n\nexport type ArchType = \"x64\" | \"ia32\" | \"armv7l\" | \"arm64\"\n\nexport function toLinuxArchString(arch: Arch, targetName: string): string {\n  switch (arch) {\n    case Arch.x64:\n      return \"amd64\"\n    case Arch.ia32:\n      return targetName === \"pacman\" ? \"i686\" : \"i386\"\n    case Arch.armv7l:\n      return targetName === \"snap\" || targetName === \"deb\" ? \"armhf\" : \"armv7l\"\n    case Arch.arm64:\n      return \"arm64\"\n\n    default:\n      throw new Error(`Unsupported arch ${arch}`)\n  }\n}\n\nexport function getArchCliNames(): Array<string> {\n  return [Arch[Arch.ia32], Arch[Arch.x64], Arch[Arch.armv7l], Arch[Arch.arm64]]\n}\n\nexport function getArchSuffix(arch: Arch): string {\n  return arch === Arch.x64 ? \"\" : `-${Arch[arch]}`\n}\n\nexport function archFromString(name: string): Arch {\n  switch (name) {\n    case \"x64\":\n      return Arch.x64\n    case \"ia32\":\n      return Arch.ia32\n    case \"arm64\":\n      return Arch.arm64\n    case \"armv7l\":\n      return Arch.armv7l\n\n    default:\n      throw new Error(`Unsupported arch ${name}`)\n  }\n}\n\nexport function getArtifactArchName(arch: Arch, ext: string): string {\n  let archName = Arch[arch]\n  const isAppImage = ext === \"AppImage\" || ext === \"appimage\"\n  if (arch === Arch.x64) {\n    if (isAppImage || ext === \"rpm\") {\n      archName = \"x86_64\"\n    }\n    else if (ext === \"deb\" || ext === \"snap\") {\n      archName = \"amd64\"\n    }\n  }\n  else if (arch === Arch.ia32) {\n    if (ext === \"deb\" || isAppImage || ext === \"snap\") {\n      archName = \"i386\"\n    }\n    else if (ext === \"pacman\" || ext === \"rpm\") {\n      archName = \"i686\"\n    }\n  }\n  else if (arch === Arch.armv7l) {\n    if (ext === \"snap\") {\n      archName = \"armhf\"\n    }\n  }\n  return archName\n}"],"sourceRoot":""}
 | 
			
		||||
							
								
								
									
										11
									
								
								app/node_modules/builder-util/out/asyncTaskManager.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								app/node_modules/builder-util/out/asyncTaskManager.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal 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>>;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										128
									
								
								app/node_modules/builder-util/out/asyncTaskManager.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										128
									
								
								app/node_modules/builder-util/out/asyncTaskManager.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,128 @@
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
Object.defineProperty(exports, "__esModule", {
 | 
			
		||||
  value: true
 | 
			
		||||
});
 | 
			
		||||
exports.AsyncTaskManager = void 0;
 | 
			
		||||
 | 
			
		||||
function _log() {
 | 
			
		||||
  const data = require("./log");
 | 
			
		||||
 | 
			
		||||
  _log = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _promise() {
 | 
			
		||||
  const data = require("./promise");
 | 
			
		||||
 | 
			
		||||
  _promise = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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().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().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 [];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        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().NestedError)(errors, "Cannot cleanup: ");
 | 
			
		||||
  }
 | 
			
		||||
} 
 | 
			
		||||
// __ts-babel@6.0.4
 | 
			
		||||
//# sourceMappingURL=asyncTaskManager.js.map
 | 
			
		||||
							
								
								
									
										1
									
								
								app/node_modules/builder-util/out/asyncTaskManager.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								app/node_modules/builder-util/out/asyncTaskManager.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
{"version":3,"sources":["../src/asyncTaskManager.ts"],"names":[],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEM,MAAO,gBAAP,CAAuB;AAI3B,EAAA,WAAA,CAA6B,iBAA7B,EAAiE;AAApC,SAAA,iBAAA,GAAA,iBAAA;AAHpB,SAAA,KAAA,GAA6B,EAA7B;AACQ,SAAA,MAAA,GAAuB,EAAvB;AAGhB;;AAED,EAAA,GAAG,CAAC,IAAD,EAAyB;AAC1B,QAAI,KAAK,iBAAL,IAA0B,IAA1B,IAAkC,CAAC,KAAK,iBAAL,CAAuB,SAA9D,EAAyE;AACvE,WAAK,OAAL,CAAa,IAAI,EAAjB;AACD;AACF;;AAED,EAAA,OAAO,CAAC,OAAD,EAAsB;AAC3B,QAAI,KAAK,iBAAL,CAAuB,SAA3B,EAAsC;AACpC,iBAAI,KAAJ,CAAU;AAAC,QAAA,MAAM,EAAE,WAAT;AAAsB,QAAA,KAAK,EAAE,IAAI,KAAJ,GAAY;AAAzC,OAAV,EAA2D,sBAA3D;;AACA,UAAI,YAAY,OAAhB,EAAyB;AACtB,QAAA,OAAe,CAAC,MAAhB;AACF;;AACD;AACD;;AAED,SAAK,KAAL,CAAW,IAAX,CAAgB,OAAO,CACpB,KADa,CACP,EAAE,IAAG;AACV,iBAAI,KAAJ,CAAU;AAAC,QAAA,KAAK,EAAE,EAAE,CAAC,OAAH,IAAc,EAAE,CAAC,QAAH;AAAtB,OAAV,EAAgD,kBAAhD;;AACA,WAAK,MAAL,CAAY,IAAZ,CAAiB,EAAjB;AACA,aAAO,OAAO,CAAC,OAAR,CAAgB,IAAhB,CAAP;AACD,KALa,CAAhB;AAMD;;AAED,EAAA,WAAW,GAAA;AACT,SAAK,MAAM,IAAX,IAAmB,KAAK,KAAxB,EAA+B;AAC7B,UAAI,YAAY,IAAhB,EAAsB;AACnB,QAAA,IAAY,CAAC,MAAb;AACF;AACF;;AACD,SAAK,KAAL,CAAW,MAAX,GAAoB,CAApB;AACD;;AAED,QAAM,UAAN,GAAgB;AACd,QAAI,KAAK,iBAAL,CAAuB,SAA3B,EAAsC;AACpC,WAAK,WAAL;AACA,aAAO,EAAP;AACD;;AAED,UAAM,WAAW,GAAG,MAAK;AACvB,UAAI,KAAK,MAAL,CAAY,MAAZ,GAAqB,CAAzB,EAA4B;AAC1B,aAAK,WAAL;AACA,QAAA,UAAU,CAAC,KAAK,MAAN,CAAV;AACA;AACD;AACF,KAND;;AAQA,IAAA,WAAW;AAEX,QAAI,MAAM,GAAsB,IAAhC;AACA,UAAM,KAAK,GAAG,KAAK,KAAnB;AACA,QAAI,IAAI,GAAG,KAAK,CAAC,KAAN,EAAX;AACA,IAAA,KAAK,CAAC,MAAN,GAAe,CAAf;;AACA,WAAO,IAAI,CAAC,MAAL,GAAc,CAArB,EAAwB;AACtB,YAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAR,CAAY,IAAZ,CAAxB;AACA,MAAA,MAAM,GAAG,MAAM,IAAI,IAAV,GAAiB,SAAjB,GAA6B,MAAM,CAAC,MAAP,CAAc,SAAd,CAAtC;AACA,MAAA,WAAW;;AACX,UAAI,KAAK,CAAC,MAAN,KAAiB,CAArB,EAAwB;AACtB;AACD,OAFD,MAGK;AACH,YAAI,KAAK,iBAAL,CAAuB,SAA3B,EAAsC;AACpC,eAAK,WAAL;AACA,iBAAO,EAAP;AACD;;AAED,QAAA,IAAI,GAAG,KAAK,CAAC,KAAN,EAAP;AACA,QAAA,KAAK,CAAC,MAAN,GAAe,CAAf;AACD;AACF;;AACD,WAAO,MAAM,IAAI,EAAjB;AACD;;AA7E0B;;;;AAgF7B,SAAS,UAAT,CAAoB,MAApB,EAAwC;AACtC,MAAI,MAAM,CAAC,MAAP,KAAkB,CAAtB,EAAyB;AACvB,UAAM,MAAM,CAAC,CAAD,CAAZ;AACD,GAFD,MAGK,IAAI,MAAM,CAAC,MAAP,GAAgB,CAApB,EAAuB;AAC1B,UAAM,KAAI,sBAAJ,EAAgB,MAAhB,EAAwB,kBAAxB,CAAN;AACD;AACF,C","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\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(promise\n      .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  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      }\n      else {\n        if (this.cancellationToken.cancelled) {\n          this.cancelTasks()\n          return []\n        }\n\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  }\n  else if (errors.length > 1) {\n    throw new NestedError(errors, \"Cannot cleanup: \")\n  }\n}"],"sourceRoot":""}
 | 
			
		||||
							
								
								
									
										1
									
								
								app/node_modules/builder-util/out/deepAssign.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								app/node_modules/builder-util/out/deepAssign.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
export declare function deepAssign<T>(target: T, ...objects: Array<any>): T;
 | 
			
		||||
							
								
								
									
										53
									
								
								app/node_modules/builder-util/out/deepAssign.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								app/node_modules/builder-util/out/deepAssign.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,53 @@
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
Object.defineProperty(exports, "__esModule", {
 | 
			
		||||
  value: true
 | 
			
		||||
});
 | 
			
		||||
exports.deepAssign = deepAssign;
 | 
			
		||||
 | 
			
		||||
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)) {
 | 
			
		||||
    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;
 | 
			
		||||
} 
 | 
			
		||||
// __ts-babel@6.0.4
 | 
			
		||||
//# sourceMappingURL=deepAssign.js.map
 | 
			
		||||
							
								
								
									
										1
									
								
								app/node_modules/builder-util/out/deepAssign.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								app/node_modules/builder-util/out/deepAssign.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
{"version":3,"sources":["../src/deepAssign.ts"],"names":[],"mappings":";;;;;;;AAAA,SAAS,QAAT,CAAkB,CAAlB,EAAwB;AACtB,MAAI,KAAK,CAAC,OAAN,CAAc,CAAd,CAAJ,EAAsB;AACpB,WAAO,KAAP;AACD;;AAED,QAAM,IAAI,GAAG,OAAO,CAApB;AACA,SAAO,IAAI,KAAK,QAAT,IAAqB,IAAI,KAAK,UAArC;AACD;;AAED,SAAS,SAAT,CAAmB,MAAnB,EAAgC,IAAhC,EAA2C,GAA3C,EAAsD;AACpD,QAAM,KAAK,GAAG,IAAI,CAAC,GAAD,CAAlB,CADoD,CAEpD;;AACA,MAAI,KAAK,KAAK,SAAd,EAAyB;AACvB;AACD;;AAED,QAAM,SAAS,GAAG,MAAM,CAAC,GAAD,CAAxB;;AACA,MAAI,SAAS,IAAI,IAAb,IAAqB,KAAK,IAAI,IAA9B,IAAsC,CAAC,QAAQ,CAAC,SAAD,CAA/C,IAA8D,CAAC,QAAQ,CAAC,KAAD,CAA3E,EAAoF;AAClF,IAAA,MAAM,CAAC,GAAD,CAAN,GAAc,KAAd;AACD,GAFD,MAGK;AACH,IAAA,MAAM,CAAC,GAAD,CAAN,GAAc,MAAM,CAAC,SAAD,EAAY,KAAZ,CAApB;AACD;AACF;;AAED,SAAS,MAAT,CAAgB,EAAhB,EAAyB,IAAzB,EAAkC;AAChC,MAAI,EAAE,KAAK,IAAX,EAAiB;AACf,SAAK,MAAM,GAAX,IAAkB,MAAM,CAAC,mBAAP,CAA2B,IAA3B,CAAlB,EAAoD;AAClD,MAAA,SAAS,CAAC,EAAD,EAAK,IAAL,EAAW,GAAX,CAAT;AACD;AACF;;AACD,SAAO,EAAP;AACD;;AAEK,SAAU,UAAV,CAAwB,MAAxB,EAAmC,GAAG,OAAtC,EAAyD;AAC7D,OAAK,MAAM,CAAX,IAAgB,OAAhB,EAAyB;AACvB,QAAI,CAAC,IAAI,IAAT,EAAe;AACb,MAAA,MAAM,CAAC,MAAD,EAAS,CAAT,CAAN;AACD;AACF;;AACD,SAAO,MAAP;AACD,C","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    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}"],"sourceRoot":""}
 | 
			
		||||
							
								
								
									
										58
									
								
								app/node_modules/builder-util/out/fs.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								app/node_modules/builder-util/out/fs.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,58 @@
 | 
			
		||||
/// <reference types="node" />
 | 
			
		||||
import { Stats } from "fs-extra";
 | 
			
		||||
export declare const MAX_FILE_REQUESTS = 8;
 | 
			
		||||
export declare const CONCURRENCY: {
 | 
			
		||||
    concurrency: number;
 | 
			
		||||
};
 | 
			
		||||
export declare type AfterCopyFileTransformer = (file: string) => Promise<void>;
 | 
			
		||||
export declare class CopyFileTransformer {
 | 
			
		||||
    readonly afterCopyTransformer: AfterCopyFileTransformer;
 | 
			
		||||
    constructor(afterCopyTransformer: AfterCopyFileTransformer);
 | 
			
		||||
}
 | 
			
		||||
export declare type FileTransformer = (file: string) => Promise<null | string | Buffer | CopyFileTransformer> | null | string | Buffer | CopyFileTransformer;
 | 
			
		||||
export declare 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 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;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										382
									
								
								app/node_modules/builder-util/out/fs.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										382
									
								
								app/node_modules/builder-util/out/fs.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,382 @@
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
Object.defineProperty(exports, "__esModule", {
 | 
			
		||||
  value: true
 | 
			
		||||
});
 | 
			
		||||
exports.unlinkIfExists = unlinkIfExists;
 | 
			
		||||
exports.statOrNull = statOrNull;
 | 
			
		||||
exports.exists = exists;
 | 
			
		||||
exports.walk = walk;
 | 
			
		||||
exports.copyFile = copyFile;
 | 
			
		||||
exports.copyOrLinkFile = copyOrLinkFile;
 | 
			
		||||
exports.copyDir = copyDir;
 | 
			
		||||
exports.USE_HARD_LINKS = exports.DO_NOT_USE_HARD_LINKS = exports.FileCopier = exports.CopyFileTransformer = exports.CONCURRENCY = exports.MAX_FILE_REQUESTS = void 0;
 | 
			
		||||
 | 
			
		||||
function _bluebirdLst() {
 | 
			
		||||
  const data = _interopRequireDefault(require("bluebird-lst"));
 | 
			
		||||
 | 
			
		||||
  _bluebirdLst = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _fsExtra() {
 | 
			
		||||
  const data = require("fs-extra");
 | 
			
		||||
 | 
			
		||||
  _fsExtra = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var path = _interopRequireWildcard(require("path"));
 | 
			
		||||
 | 
			
		||||
function _statMode() {
 | 
			
		||||
  const data = _interopRequireDefault(require("stat-mode"));
 | 
			
		||||
 | 
			
		||||
  _statMode = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _log() {
 | 
			
		||||
  const data = require("./log");
 | 
			
		||||
 | 
			
		||||
  _log = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _promise() {
 | 
			
		||||
  const data = require("./promise");
 | 
			
		||||
 | 
			
		||||
  _promise = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
 | 
			
		||||
 | 
			
		||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 | 
			
		||||
 | 
			
		||||
const MAX_FILE_REQUESTS = 8;
 | 
			
		||||
exports.MAX_FILE_REQUESTS = MAX_FILE_REQUESTS;
 | 
			
		||||
const CONCURRENCY = {
 | 
			
		||||
  concurrency: MAX_FILE_REQUESTS
 | 
			
		||||
};
 | 
			
		||||
exports.CONCURRENCY = CONCURRENCY;
 | 
			
		||||
 | 
			
		||||
class CopyFileTransformer {
 | 
			
		||||
  constructor(afterCopyTransformer) {
 | 
			
		||||
    this.afterCopyTransformer = afterCopyTransformer;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exports.CopyFileTransformer = CopyFileTransformer;
 | 
			
		||||
 | 
			
		||||
function unlinkIfExists(file) {
 | 
			
		||||
  return (0, _fsExtra().unlink)(file).catch(() => {});
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
async function statOrNull(file) {
 | 
			
		||||
  return (0, _promise().orNullIfFileNotExist)((0, _fsExtra().stat)(file));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
async function exists(file) {
 | 
			
		||||
  try {
 | 
			
		||||
    await (0, _fsExtra().access)(file);
 | 
			
		||||
    return true;
 | 
			
		||||
  } catch (e) {
 | 
			
		||||
    return false;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
/**
 | 
			
		||||
 * 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().orIfFileNotExist)((0, _fsExtra().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 _bluebirdLst().default.map(childNames, name => {
 | 
			
		||||
      if (name === ".DS_Store" || name === ".gitkeep") {
 | 
			
		||||
        return null;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      const filePath = dirPath + path.sep + name;
 | 
			
		||||
      return (0, _fsExtra().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;
 | 
			
		||||
            }
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    }, 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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const _isUseHardLink = process.platform !== "win32" && process.env.USE_HARD_LINKS !== "false" && (require("is-ci") || process.env.USE_HARD_LINKS === "true");
 | 
			
		||||
 | 
			
		||||
function copyFile(src, dest, isEnsureDir = true) {
 | 
			
		||||
  return (isEnsureDir ? (0, _fsExtra().ensureDir)(path.dirname(dest)) : Promise.resolve()).then(() => copyOrLinkFile(src, dest, null, false));
 | 
			
		||||
}
 | 
			
		||||
/**
 | 
			
		||||
 * 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 (_statMode().default)(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().log.isDebugEnabled) {
 | 
			
		||||
        const oldMode = new (_statMode().default)({
 | 
			
		||||
          mode: originalModeNumber
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        _log().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().log.debug({
 | 
			
		||||
          dest
 | 
			
		||||
        }, "copied, but not linked, because file permissions need to be fixed");
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (isUseHardLink) {
 | 
			
		||||
    return (0, _fsExtra().link)(src, dest).catch(e => {
 | 
			
		||||
      if (e.code === "EXDEV") {
 | 
			
		||||
        const isLog = exDevErrorHandler == null ? true : exDevErrorHandler();
 | 
			
		||||
 | 
			
		||||
        if (isLog && _log().log.isDebugEnabled) {
 | 
			
		||||
          _log().log.debug({
 | 
			
		||||
            error: e.message
 | 
			
		||||
          }, "cannot copy using hard link");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return doCopyFile(src, dest, stats);
 | 
			
		||||
      } else {
 | 
			
		||||
        throw e;
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return doCopyFile(src, dest, stats);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function doCopyFile(src, dest, stats) {
 | 
			
		||||
  const promise = (0, _fsExtra().copyFile)(src, dest);
 | 
			
		||||
 | 
			
		||||
  if (stats == null) {
 | 
			
		||||
    return promise;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return promise.then(() => (0, _fsExtra().chmod)(dest, stats.mode));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class FileCopier {
 | 
			
		||||
  constructor(isUseHardLinkFunction, transformer) {
 | 
			
		||||
    this.isUseHardLinkFunction = isUseHardLinkFunction;
 | 
			
		||||
    this.transformer = transformer;
 | 
			
		||||
 | 
			
		||||
    if (isUseHardLinkFunction === USE_HARD_LINKS) {
 | 
			
		||||
      this.isUseHardLink = true;
 | 
			
		||||
    } else {
 | 
			
		||||
      this.isUseHardLink = _isUseHardLink && isUseHardLinkFunction !== 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, _fsExtra().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);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
/**
 | 
			
		||||
 * Empty directories is never created.
 | 
			
		||||
 * Hard links is used if supported and allowed.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
exports.FileCopier = FileCopier;
 | 
			
		||||
 | 
			
		||||
function copyDir(src, destination, options = {}) {
 | 
			
		||||
  const fileCopier = new FileCopier(options.isUseHardLink, options.transformer);
 | 
			
		||||
 | 
			
		||||
  if (_log().log.isDebugEnabled) {
 | 
			
		||||
    _log().log.debug({
 | 
			
		||||
      src,
 | 
			
		||||
      destination
 | 
			
		||||
    }, `copying${fileCopier.isUseHardLink ? " using hard links" : ""}`);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  const createdSourceDirs = new Set();
 | 
			
		||||
  const links = [];
 | 
			
		||||
  return walk(src, options.filter, {
 | 
			
		||||
    consume: async (file, stat, parent) => {
 | 
			
		||||
      if (!stat.isFile() && !stat.isSymbolicLink()) {
 | 
			
		||||
        return;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (!createdSourceDirs.has(parent)) {
 | 
			
		||||
        await (0, _fsExtra().ensureDir)(parent.replace(src, destination));
 | 
			
		||||
        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, _fsExtra().readlink)(file)
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }).then(() => _bluebirdLst().default.map(links, it => (0, _fsExtra().symlink)(it.link, it.file), CONCURRENCY));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const DO_NOT_USE_HARD_LINKS = file => false;
 | 
			
		||||
 | 
			
		||||
exports.DO_NOT_USE_HARD_LINKS = DO_NOT_USE_HARD_LINKS;
 | 
			
		||||
 | 
			
		||||
const USE_HARD_LINKS = file => true; exports.USE_HARD_LINKS = USE_HARD_LINKS;
 | 
			
		||||
// __ts-babel@6.0.4
 | 
			
		||||
//# sourceMappingURL=fs.js.map
 | 
			
		||||
							
								
								
									
										1
									
								
								app/node_modules/builder-util/out/fs.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								app/node_modules/builder-util/out/fs.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										26
									
								
								app/node_modules/builder-util/out/log.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								app/node_modules/builder-util/out/log.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal 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 declare 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;
 | 
			
		||||
    readonly 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;
 | 
			
		||||
							
								
								
									
										151
									
								
								app/node_modules/builder-util/out/log.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										151
									
								
								app/node_modules/builder-util/out/log.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,151 @@
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
Object.defineProperty(exports, "__esModule", {
 | 
			
		||||
  value: true
 | 
			
		||||
});
 | 
			
		||||
exports.setPrinter = setPrinter;
 | 
			
		||||
exports.log = exports.Logger = exports.PADDING = exports.debug = void 0;
 | 
			
		||||
 | 
			
		||||
function _chalk() {
 | 
			
		||||
  const data = _interopRequireDefault(require("chalk"));
 | 
			
		||||
 | 
			
		||||
  _chalk = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var _debug2 = _interopRequireDefault(require("debug"));
 | 
			
		||||
 | 
			
		||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 | 
			
		||||
 | 
			
		||||
let printer = null;
 | 
			
		||||
const debug = (0, _debug2.default)("electron-builder");
 | 
			
		||||
exports.debug = debug;
 | 
			
		||||
 | 
			
		||||
function setPrinter(value) {
 | 
			
		||||
  printer = value;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const PADDING = 2;
 | 
			
		||||
exports.PADDING = PADDING;
 | 
			
		||||
 | 
			
		||||
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 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 (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(PADDING)}${color(levelIndicator)} `);
 | 
			
		||||
    this.stream.write(Logger.createMessage(this.messageTransformer(message, level), fields, level, color, 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;
 | 
			
		||||
 | 
			
		||||
      if (fieldValue != null && typeof fieldValue === "string" && fieldValue.includes("\n")) {
 | 
			
		||||
        valuePadding = " ".repeat(messagePadding + message.length + fieldPadding.length + 2);
 | 
			
		||||
        fieldValue = "\n" + valuePadding + fieldValue.replace(/\n/g, `\n${valuePadding}`);
 | 
			
		||||
      } else if (Array.isArray(fieldValue)) {
 | 
			
		||||
        fieldValue = JSON.stringify(fieldValue);
 | 
			
		||||
      } else if (Array.isArray(fieldValue)) {
 | 
			
		||||
        fieldValue = JSON.stringify(fieldValue);
 | 
			
		||||
      } else if (typeof fieldValue === "object") {// fieldValue = safeStringifyJson(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().default.blue,
 | 
			
		||||
  warn: _chalk().default.yellow,
 | 
			
		||||
  error: _chalk().default.red,
 | 
			
		||||
  debug: _chalk().default.white
 | 
			
		||||
};
 | 
			
		||||
const log = new Logger(process.stdout); exports.log = log;
 | 
			
		||||
// __ts-babel@6.0.4
 | 
			
		||||
//# sourceMappingURL=log.js.map
 | 
			
		||||
							
								
								
									
										1
									
								
								app/node_modules/builder-util/out/log.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								app/node_modules/builder-util/out/log.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										7
									
								
								app/node_modules/builder-util/out/nodeHttpExecutor.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								app/node_modules/builder-util/out/nodeHttpExecutor.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal 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): any;
 | 
			
		||||
}
 | 
			
		||||
export declare const httpExecutor: NodeHttpExecutor;
 | 
			
		||||
							
								
								
									
										52
									
								
								app/node_modules/builder-util/out/nodeHttpExecutor.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								app/node_modules/builder-util/out/nodeHttpExecutor.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,52 @@
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
Object.defineProperty(exports, "__esModule", {
 | 
			
		||||
  value: true
 | 
			
		||||
});
 | 
			
		||||
exports.httpExecutor = exports.NodeHttpExecutor = void 0;
 | 
			
		||||
 | 
			
		||||
function _builderUtilRuntime() {
 | 
			
		||||
  const data = require("builder-util-runtime");
 | 
			
		||||
 | 
			
		||||
  _builderUtilRuntime = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _http() {
 | 
			
		||||
  const data = require("http");
 | 
			
		||||
 | 
			
		||||
  _http = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function https() {
 | 
			
		||||
  const data = _interopRequireWildcard(require("https"));
 | 
			
		||||
 | 
			
		||||
  https = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
 | 
			
		||||
 | 
			
		||||
class NodeHttpExecutor extends _builderUtilRuntime().HttpExecutor {
 | 
			
		||||
  // noinspection JSMethodCanBeStatic
 | 
			
		||||
  // noinspection JSUnusedGlobalSymbols
 | 
			
		||||
  createRequest(options, callback) {
 | 
			
		||||
    return (options.protocol === "http:" ? _http().request : https().request)(options, callback);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exports.NodeHttpExecutor = NodeHttpExecutor;
 | 
			
		||||
const httpExecutor = new NodeHttpExecutor(); exports.httpExecutor = httpExecutor;
 | 
			
		||||
// __ts-babel@6.0.4
 | 
			
		||||
//# sourceMappingURL=nodeHttpExecutor.js.map
 | 
			
		||||
							
								
								
									
										1
									
								
								app/node_modules/builder-util/out/nodeHttpExecutor.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								app/node_modules/builder-util/out/nodeHttpExecutor.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
{"version":3,"sources":["../src/nodeHttpExecutor.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEM,MAAO,gBAAP,SAAgC,kCAAhC,CAA2D;AAC/D;AACA;AACA,EAAA,aAAa,CAAC,OAAD,EAAe,QAAf,EAAgD;AAC3D,WAAO,CAAC,OAAO,CAAC,QAAR,KAAqB,OAArB,GAA+B,eAA/B,GAA6C,KAAK,GAAC,OAApD,EAA6D,OAA7D,EAAsE,QAAtE,CAAP;AACD;;AAL8D;;;AAQ1D,MAAM,YAAY,GAAG,IAAI,gBAAJ,EAArB,C","sourcesContent":["import { HttpExecutor } from \"builder-util-runtime\"\nimport { ClientRequest, request as httpRequest } from \"http\"\nimport * as https from \"https\"\n\nexport class NodeHttpExecutor extends HttpExecutor<ClientRequest> {\n  // noinspection JSMethodCanBeStatic\n  // noinspection JSUnusedGlobalSymbols\n  createRequest(options: any, callback: (response: any) => void): any {\n    return (options.protocol === \"http:\" ? httpRequest : https.request)(options, callback)\n  }\n}\n\nexport const httpExecutor = new NodeHttpExecutor()"],"sourceRoot":""}
 | 
			
		||||
							
								
								
									
										7
									
								
								app/node_modules/builder-util/out/promise.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								app/node_modules/builder-util/out/promise.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal 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>;
 | 
			
		||||
							
								
								
									
										80
									
								
								app/node_modules/builder-util/out/promise.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										80
									
								
								app/node_modules/builder-util/out/promise.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,80 @@
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
Object.defineProperty(exports, "__esModule", {
 | 
			
		||||
  value: true
 | 
			
		||||
});
 | 
			
		||||
exports.printErrorAndExit = printErrorAndExit;
 | 
			
		||||
exports.executeFinally = executeFinally;
 | 
			
		||||
exports.orNullIfFileNotExist = orNullIfFileNotExist;
 | 
			
		||||
exports.orIfFileNotExist = orIfFileNotExist;
 | 
			
		||||
exports.NestedError = void 0;
 | 
			
		||||
 | 
			
		||||
function _chalk() {
 | 
			
		||||
  const data = _interopRequireDefault(require("chalk"));
 | 
			
		||||
 | 
			
		||||
  _chalk = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 | 
			
		||||
 | 
			
		||||
function printErrorAndExit(error) {
 | 
			
		||||
  console.error(_chalk().default.red((error.stack || error).toString()));
 | 
			
		||||
  process.exit(1);
 | 
			
		||||
} // 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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function orIfFileNotExist(promise, fallbackValue) {
 | 
			
		||||
  return promise.catch(e => {
 | 
			
		||||
    if (e.code === "ENOENT" || e.code === "ENOTDIR") {
 | 
			
		||||
      return fallbackValue;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    throw e;
 | 
			
		||||
  });
 | 
			
		||||
} 
 | 
			
		||||
// __ts-babel@6.0.4
 | 
			
		||||
//# sourceMappingURL=promise.js.map
 | 
			
		||||
							
								
								
									
										1
									
								
								app/node_modules/builder-util/out/promise.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								app/node_modules/builder-util/out/promise.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
{"version":3,"sources":["../src/promise.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEM,SAAU,iBAAV,CAA4B,KAA5B,EAAwC;AAC5C,EAAA,OAAO,CAAC,KAAR,CAAc,iBAAM,GAAN,CAAU,CAAC,KAAK,CAAC,KAAN,IAAe,KAAhB,EAAuB,QAAvB,EAAV,CAAd;AACA,EAAA,OAAO,CAAC,IAAR,CAAa,CAAb;AACD,C,CAED;;;AACO,eAAe,cAAf,CAAiC,OAAjC,EAAsD,IAAtD,EAAsG;AAC3G,MAAI,MAAM,GAAa,IAAvB;;AACA,MAAI;AACF,IAAA,MAAM,GAAG,MAAM,OAAf;AACD,GAFD,CAGA,OAAO,aAAP,EAAsB;AACpB,QAAI;AACF,YAAM,IAAI,CAAC,IAAD,CAAV;AACD,KAFD,CAGA,OAAO,SAAP,EAAkB;AAChB,YAAM,IAAI,WAAJ,CAAgB,CAAC,aAAD,EAAgB,SAAhB,CAAhB,CAAN;AACD;;AAED,UAAM,aAAN;AACD;;AAED,QAAM,IAAI,CAAC,KAAD,CAAV;AACA,SAAO,MAAP;AACD;;AAEK,MAAO,WAAP,SAA2B,KAA3B,CAAgC;AACpC,EAAA,WAAA,CAAY,MAAZ,EAAkC,OAAA,GAAkB,kBAApD,EAAsE;AACpE,QAAI,CAAC,GAAG,OAAR;AACA,QAAI,CAAC,GAAG,CAAR;;AACA,SAAK,MAAM,KAAX,IAAoB,MAApB,EAA4B;AAC1B,YAAM,MAAM,GAAG,UAAU,CAAC,EAAE,GAA5B;AACA,MAAA,CAAC,IAAI,SAAS,MAAT,GAAkB,IAAI,MAAJ,CAAW,EAAX,CAAlB,GAAmC,IAAnC,GAA0C,KAAM,CAAC,KAAtD;AACD;;AACD,UAAM,CAAN;AACD;;AATmC;;;;AAYhC,SAAU,oBAAV,CAAkC,OAAlC,EAAqD;AACzD,SAAO,gBAAgB,CAAC,OAAD,EAAU,IAAV,CAAvB;AACD;;AAEK,SAAU,gBAAV,CAA8B,OAA9B,EAAmD,aAAnD,EAAmE;AACvE,SAAO,OAAO,CACX,KADI,CACE,CAAC,IAAG;AACT,QAAI,CAAC,CAAC,IAAF,KAAW,QAAX,IAAuB,CAAC,CAAC,IAAF,KAAW,SAAtC,EAAiD;AAC/C,aAAO,aAAP;AACD;;AACD,UAAM,CAAN;AACD,GANI,CAAP;AAOD,C","sourcesContent":["import 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  }\n  catch (originalError) {\n    try {\n      await task(true)\n    }\n    catch (taskError) {\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: string = \"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\n    .catch(e => {\n      if (e.code === \"ENOENT\" || e.code === \"ENOTDIR\") {\n        return fallbackValue\n      }\n      throw e\n    })\n}"],"sourceRoot":""}
 | 
			
		||||
							
								
								
									
										40
									
								
								app/node_modules/builder-util/out/util.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								app/node_modules/builder-util/out/util.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,40 @@
 | 
			
		||||
/// <reference types="node" />
 | 
			
		||||
import { ChildProcess, ExecFileOptions, SpawnOptions } from "child_process";
 | 
			
		||||
import _debug from "debug";
 | 
			
		||||
import "source-map-support/register";
 | 
			
		||||
export { safeStringifyJson } from "builder-util-runtime";
 | 
			
		||||
export { TmpDir } from "temp-file";
 | 
			
		||||
export { log, debug } from "./log";
 | 
			
		||||
export { Arch, getArchCliNames, toLinuxArchString, getArchSuffix, ArchType, archFromString } from "./arch";
 | 
			
		||||
export { AsyncTaskManager } from "./asyncTaskManager";
 | 
			
		||||
export { DebugLogger } from "./DebugLogger";
 | 
			
		||||
export { copyFile } from "./fs";
 | 
			
		||||
export { asArray } from "builder-util-runtime";
 | 
			
		||||
export { deepAssign } from "./deepAssign";
 | 
			
		||||
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);
 | 
			
		||||
}
 | 
			
		||||
export declare function use<T, R>(value: T | null, task: (it: 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): Promise<string>;
 | 
			
		||||
							
								
								
									
										623
									
								
								app/node_modules/builder-util/out/util.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										623
									
								
								app/node_modules/builder-util/out/util.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,623 @@
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
Object.defineProperty(exports, "__esModule", {
 | 
			
		||||
  value: true
 | 
			
		||||
});
 | 
			
		||||
exports.serializeToYaml = serializeToYaml;
 | 
			
		||||
exports.removePassword = removePassword;
 | 
			
		||||
exports.exec = exec;
 | 
			
		||||
exports.doSpawn = doSpawn;
 | 
			
		||||
exports.spawnAndWrite = spawnAndWrite;
 | 
			
		||||
exports.spawn = spawn;
 | 
			
		||||
exports.use = use;
 | 
			
		||||
exports.isEmptyOrSpaces = isEmptyOrSpaces;
 | 
			
		||||
exports.isTokenCharValid = isTokenCharValid;
 | 
			
		||||
exports.addValue = addValue;
 | 
			
		||||
exports.replaceDefault = replaceDefault;
 | 
			
		||||
exports.getPlatformIconFileName = getPlatformIconFileName;
 | 
			
		||||
exports.isPullRequest = isPullRequest;
 | 
			
		||||
exports.isEnvTrue = isEnvTrue;
 | 
			
		||||
exports.executeAppBuilder = executeAppBuilder;
 | 
			
		||||
Object.defineProperty(exports, "safeStringifyJson", {
 | 
			
		||||
  enumerable: true,
 | 
			
		||||
  get: function () {
 | 
			
		||||
    return _builderUtilRuntime().safeStringifyJson;
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
Object.defineProperty(exports, "asArray", {
 | 
			
		||||
  enumerable: true,
 | 
			
		||||
  get: function () {
 | 
			
		||||
    return _builderUtilRuntime().asArray;
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
Object.defineProperty(exports, "log", {
 | 
			
		||||
  enumerable: true,
 | 
			
		||||
  get: function () {
 | 
			
		||||
    return _log().log;
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
Object.defineProperty(exports, "debug", {
 | 
			
		||||
  enumerable: true,
 | 
			
		||||
  get: function () {
 | 
			
		||||
    return _log().debug;
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
Object.defineProperty(exports, "TmpDir", {
 | 
			
		||||
  enumerable: true,
 | 
			
		||||
  get: function () {
 | 
			
		||||
    return _tempFile().TmpDir;
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
Object.defineProperty(exports, "Arch", {
 | 
			
		||||
  enumerable: true,
 | 
			
		||||
  get: function () {
 | 
			
		||||
    return _arch().Arch;
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
Object.defineProperty(exports, "getArchCliNames", {
 | 
			
		||||
  enumerable: true,
 | 
			
		||||
  get: function () {
 | 
			
		||||
    return _arch().getArchCliNames;
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
Object.defineProperty(exports, "toLinuxArchString", {
 | 
			
		||||
  enumerable: true,
 | 
			
		||||
  get: function () {
 | 
			
		||||
    return _arch().toLinuxArchString;
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
Object.defineProperty(exports, "getArchSuffix", {
 | 
			
		||||
  enumerable: true,
 | 
			
		||||
  get: function () {
 | 
			
		||||
    return _arch().getArchSuffix;
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
Object.defineProperty(exports, "archFromString", {
 | 
			
		||||
  enumerable: true,
 | 
			
		||||
  get: function () {
 | 
			
		||||
    return _arch().archFromString;
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
Object.defineProperty(exports, "AsyncTaskManager", {
 | 
			
		||||
  enumerable: true,
 | 
			
		||||
  get: function () {
 | 
			
		||||
    return _asyncTaskManager().AsyncTaskManager;
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
Object.defineProperty(exports, "DebugLogger", {
 | 
			
		||||
  enumerable: true,
 | 
			
		||||
  get: function () {
 | 
			
		||||
    return _DebugLogger().DebugLogger;
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
Object.defineProperty(exports, "copyFile", {
 | 
			
		||||
  enumerable: true,
 | 
			
		||||
  get: function () {
 | 
			
		||||
    return _fs().copyFile;
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
Object.defineProperty(exports, "deepAssign", {
 | 
			
		||||
  enumerable: true,
 | 
			
		||||
  get: function () {
 | 
			
		||||
    return _deepAssign().deepAssign;
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
exports.InvalidConfigurationError = exports.ExecError = exports.debug7z = void 0;
 | 
			
		||||
 | 
			
		||||
function _zipBin() {
 | 
			
		||||
  const data = require("7zip-bin");
 | 
			
		||||
 | 
			
		||||
  _zipBin = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _appBuilderBin() {
 | 
			
		||||
  const data = require("app-builder-bin");
 | 
			
		||||
 | 
			
		||||
  _appBuilderBin = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _builderUtilRuntime() {
 | 
			
		||||
  const data = require("builder-util-runtime");
 | 
			
		||||
 | 
			
		||||
  _builderUtilRuntime = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _chalk() {
 | 
			
		||||
  const data = _interopRequireDefault(require("chalk"));
 | 
			
		||||
 | 
			
		||||
  _chalk = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _child_process() {
 | 
			
		||||
  const data = require("child_process");
 | 
			
		||||
 | 
			
		||||
  _child_process = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _crypto() {
 | 
			
		||||
  const data = require("crypto");
 | 
			
		||||
 | 
			
		||||
  _crypto = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var _debug2 = _interopRequireDefault(require("debug"));
 | 
			
		||||
 | 
			
		||||
function _jsYaml() {
 | 
			
		||||
  const data = require("js-yaml");
 | 
			
		||||
 | 
			
		||||
  _jsYaml = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var path = _interopRequireWildcard(require("path"));
 | 
			
		||||
 | 
			
		||||
require("source-map-support/register");
 | 
			
		||||
 | 
			
		||||
function _log() {
 | 
			
		||||
  const data = require("./log");
 | 
			
		||||
 | 
			
		||||
  _log = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _tempFile() {
 | 
			
		||||
  const data = require("temp-file");
 | 
			
		||||
 | 
			
		||||
  _tempFile = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _arch() {
 | 
			
		||||
  const data = require("./arch");
 | 
			
		||||
 | 
			
		||||
  _arch = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _asyncTaskManager() {
 | 
			
		||||
  const data = require("./asyncTaskManager");
 | 
			
		||||
 | 
			
		||||
  _asyncTaskManager = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _DebugLogger() {
 | 
			
		||||
  const data = require("./DebugLogger");
 | 
			
		||||
 | 
			
		||||
  _DebugLogger = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _fs() {
 | 
			
		||||
  const data = require("./fs");
 | 
			
		||||
 | 
			
		||||
  _fs = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _deepAssign() {
 | 
			
		||||
  const data = require("./deepAssign");
 | 
			
		||||
 | 
			
		||||
  _deepAssign = function () {
 | 
			
		||||
    return data;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return data;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
 | 
			
		||||
 | 
			
		||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 | 
			
		||||
 | 
			
		||||
const debug7z = (0, _debug2.default)("electron-builder:7z");
 | 
			
		||||
exports.debug7z = debug7z;
 | 
			
		||||
 | 
			
		||||
function serializeToYaml(object, skipInvalid = false, noRefs = false) {
 | 
			
		||||
  return (0, _jsYaml().safeDump)(object, {
 | 
			
		||||
    lineWidth: 8000,
 | 
			
		||||
    skipInvalid,
 | 
			
		||||
    noRefs
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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().createHash)("sha256").update(p2).digest("hex")} (sha256 hash)`;
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function getProcessEnv(env) {
 | 
			
		||||
  if (process.platform === "win32") {
 | 
			
		||||
    return env == null ? undefined : env;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  const finalEnv = Object.assign({}, 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().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 = Object.assign({}, options.env);
 | 
			
		||||
 | 
			
		||||
        for (const name of Object.keys(process.env)) {
 | 
			
		||||
          if (process.env[name] === options.env[name]) {
 | 
			
		||||
            delete diffEnv[name];
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        logFields.env = (0, _builderUtilRuntime().safeStringifyJson)(diffEnv);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    _log().log.debug(logFields, "executing");
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return new Promise((resolve, reject) => {
 | 
			
		||||
    (0, _child_process().execFile)(file, args, Object.assign({}, options, {
 | 
			
		||||
      maxBuffer: 1000 * 1024 * 1024,
 | 
			
		||||
      env: getProcessEnv(options == null ? null : options.env)
 | 
			
		||||
    }), (error, stdout, stderr) => {
 | 
			
		||||
      if (error == null) {
 | 
			
		||||
        if (isLogOutIfDebug && _log().log.isDebugEnabled) {
 | 
			
		||||
          const logFields = {
 | 
			
		||||
            file
 | 
			
		||||
          };
 | 
			
		||||
 | 
			
		||||
          if (stdout.length > 0) {
 | 
			
		||||
            logFields.stdout = stdout;
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          if (stderr.length > 0) {
 | 
			
		||||
            logFields.stderr = stderr;
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          _log().log.debug(logFields, "executed");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        resolve(stdout.toString());
 | 
			
		||||
      } else {
 | 
			
		||||
        let message = _chalk().default.red(removePassword(`Exit code: ${error.code}. ${error.message}`));
 | 
			
		||||
 | 
			
		||||
        if (stdout.length !== 0) {
 | 
			
		||||
          if (file.endsWith("wine")) {
 | 
			
		||||
            stdout = stdout.toString();
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          message += `\n${_chalk().default.yellow(stdout.toString())}`;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (stderr.length !== 0) {
 | 
			
		||||
          if (file.endsWith("wine")) {
 | 
			
		||||
            stderr = stderr.toString();
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          message += `\n${_chalk().default.red(stderr.toString())}`;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        reject(new Error(message));
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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().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().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().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, _child_process().spawn)(command, args, options);
 | 
			
		||||
  } catch (e) {
 | 
			
		||||
    throw new Error(`Cannot spawn ${command}: ${e.stack || e}`);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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();
 | 
			
		||||
      }
 | 
			
		||||
    }, error => {
 | 
			
		||||
      try {
 | 
			
		||||
        clearTimeout(timeout);
 | 
			
		||||
      } finally {
 | 
			
		||||
        reject(error.stack || error.toString());
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
    childProcess.stdin.end(data);
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function spawn(command, args, options, extraOptions) {
 | 
			
		||||
  return new Promise((resolve, reject) => {
 | 
			
		||||
    handleProcess("close", doSpawn(command, args || [], options, extraOptions), command, resolve, reject);
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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().log.isDebugEnabled) {
 | 
			
		||||
      const fields = {
 | 
			
		||||
        command: path.basename(command),
 | 
			
		||||
        code,
 | 
			
		||||
        pid: childProcess.pid
 | 
			
		||||
      };
 | 
			
		||||
 | 
			
		||||
      if (out.length > 0) {
 | 
			
		||||
        fields.out = out;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      _log().log.debug(fields, "exited");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (code === 0) {
 | 
			
		||||
      if (resolve != null) {
 | 
			
		||||
        resolve(out);
 | 
			
		||||
      }
 | 
			
		||||
    } else {
 | 
			
		||||
      reject(new ExecError(command, code, formatOut(out, "Output"), formatOut(errorOut, "Error output")));
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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} exited with code ${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);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function isEmptyOrSpaces(s) {
 | 
			
		||||
  return s == null || s.trim().length === 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function isTokenCharValid(token) {
 | 
			
		||||
  return /^[\w\/=+-]+$/.test(token);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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.CI_PULL_REQUEST) || isSet(process.env.CI_PULL_REQUESTS) || isSet(process.env.BITRISE_PULL_REQUEST) || isSet(process.env.APPVEYOR_PULL_REQUEST_NUMBER);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function isEnvTrue(value) {
 | 
			
		||||
  if (value != null) {
 | 
			
		||||
    value = value.trim();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return value === "true" || value === "" || value === "1";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class InvalidConfigurationError extends Error {
 | 
			
		||||
  constructor(message, code = "ERR_ELECTRON_BUILDER_INVALID_CONFIGURATION") {
 | 
			
		||||
    super(message);
 | 
			
		||||
    this.code = code;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exports.InvalidConfigurationError = InvalidConfigurationError;
 | 
			
		||||
 | 
			
		||||
function executeAppBuilder(args, childProcessConsumer, extraOptions = {}) {
 | 
			
		||||
  return new Promise((resolve, reject) => {
 | 
			
		||||
    const command = _appBuilderBin().appBuilderPath;
 | 
			
		||||
 | 
			
		||||
    const env = Object.assign({}, process.env, {
 | 
			
		||||
      SZA_PATH: _zipBin().path7za,
 | 
			
		||||
      FORCE_COLOR: _chalk().default.enabled ? "1" : "0"
 | 
			
		||||
    });
 | 
			
		||||
    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);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const childProcess = doSpawn(command, args, Object.assign({
 | 
			
		||||
      env,
 | 
			
		||||
      stdio: ["ignore", "pipe", process.stdout]
 | 
			
		||||
    }, extraOptions));
 | 
			
		||||
 | 
			
		||||
    if (childProcessConsumer != null) {
 | 
			
		||||
      childProcessConsumer(childProcess);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    handleProcess("close", childProcess, command, resolve, error => {
 | 
			
		||||
      if (error instanceof ExecError && error.exitCode === 2) {
 | 
			
		||||
        error.alreadyLogged = true;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      reject(error);
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
} 
 | 
			
		||||
// __ts-babel@6.0.4
 | 
			
		||||
//# sourceMappingURL=util.js.map
 | 
			
		||||
							
								
								
									
										1
									
								
								app/node_modules/builder-util/out/util.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								app/node_modules/builder-util/out/util.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Reference in New Issue
	
	Block a user