forked from olcxjas-softworks/LarpixClient
update electron to v43
This commit is contained in:
parent
68ac0beedf
commit
fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions
34
electron/node_modules/app-builder-lib/out/targets/nsis/nsisLicense.js
generated
vendored
34
electron/node_modules/app-builder-lib/out/targets/nsis/nsisLicense.js
generated
vendored
|
|
@ -1,12 +1,36 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.computeLicensePage = void 0;
|
||||
exports.computeLicensePage = computeLicensePage;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const langs_1 = require("../../util/langs");
|
||||
const license_1 = require("../../util/license");
|
||||
const path = require("path");
|
||||
const nsisUtil_1 = require("./nsisUtil");
|
||||
function convertFileToUtf8WithBOMSync(filePath) {
|
||||
var _a;
|
||||
try {
|
||||
const UTF8_BOM_HEADER = Buffer.from([0xef, 0xbb, 0xbf]);
|
||||
const data = fs.readFileSync(filePath);
|
||||
// Check if the file already starts with a UTF-8 BOM
|
||||
builder_util_1.log.debug({ file: builder_util_1.log.filePath(filePath) }, "checking file for BOM header");
|
||||
if (data.length >= UTF8_BOM_HEADER.length && data.subarray(0, UTF8_BOM_HEADER.length).equals(UTF8_BOM_HEADER)) {
|
||||
builder_util_1.log.debug({ file: builder_util_1.log.filePath(filePath) }, "file is already in BOM format, skipping conversion.");
|
||||
return true;
|
||||
}
|
||||
// If not, add the BOM
|
||||
const dataWithBOM = Buffer.concat([UTF8_BOM_HEADER, data]);
|
||||
fs.writeFileSync(filePath, dataWithBOM);
|
||||
builder_util_1.log.debug({ file: builder_util_1.log.filePath(filePath) }, "file successfully converted to UTF-8 with BOM");
|
||||
return true;
|
||||
}
|
||||
catch (err) {
|
||||
builder_util_1.log.error({ file: builder_util_1.log.filePath(filePath), message: (_a = err.message) !== null && _a !== void 0 ? _a : err.stack }, "unable to convert file to UTF-8 with BOM");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
async function computeLicensePage(packager, options, scriptGenerator, languages) {
|
||||
const license = await license_1.getNotLocalizedLicenseFile(options.license, packager);
|
||||
const license = await (0, license_1.getNotLocalizedLicenseFile)(options.license, packager);
|
||||
if (license != null) {
|
||||
let licensePage;
|
||||
if (license.endsWith(".html")) {
|
||||
|
|
@ -29,7 +53,7 @@ async function computeLicensePage(packager, options, scriptGenerator, languages)
|
|||
}
|
||||
return;
|
||||
}
|
||||
const licenseFiles = await license_1.getLicenseFiles(packager);
|
||||
const licenseFiles = await (0, license_1.getLicenseFiles)(packager);
|
||||
if (licenseFiles.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -38,6 +62,7 @@ async function computeLicensePage(packager, options, scriptGenerator, languages)
|
|||
let defaultFile = null;
|
||||
for (const item of licenseFiles) {
|
||||
unspecifiedLangs.delete(item.langWithRegion);
|
||||
convertFileToUtf8WithBOMSync(item.file);
|
||||
if (defaultFile == null) {
|
||||
defaultFile = item.file;
|
||||
}
|
||||
|
|
@ -49,5 +74,4 @@ async function computeLicensePage(packager, options, scriptGenerator, languages)
|
|||
licensePage.push('!insertmacro MUI_PAGE_LICENSE "$(MUILicense)"');
|
||||
scriptGenerator.macro("licensePage", licensePage);
|
||||
}
|
||||
exports.computeLicensePage = computeLicensePage;
|
||||
//# sourceMappingURL=nsisLicense.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue