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
17
electron/node_modules/app-builder-lib/out/util/cacheManager.js
generated
vendored
17
electron/node_modules/app-builder-lib/out/util/cacheManager.js
generated
vendored
|
|
@ -1,10 +1,8 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.digest = exports.BuildCacheManager = void 0;
|
||||
const bluebird_lst_1 = require("bluebird-lst");
|
||||
exports.BuildCacheManager = void 0;
|
||||
exports.digest = digest;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const fs_1 = require("builder-util/out/fs");
|
||||
const promise_1 = require("builder-util/out/promise");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const promises_1 = require("fs/promises");
|
||||
const path = require("path");
|
||||
|
|
@ -19,7 +17,7 @@ class BuildCacheManager {
|
|||
}
|
||||
async copyIfValid(digest) {
|
||||
this.newDigest = digest;
|
||||
this.cacheInfo = await promise_1.orNullIfFileNotExist(fs_extra_1.readJson(this.cacheInfoFile));
|
||||
this.cacheInfo = await (0, builder_util_1.orNullIfFileNotExist)((0, fs_extra_1.readJson)(this.cacheInfoFile));
|
||||
const oldDigest = this.cacheInfo == null ? null : this.cacheInfo.executableDigest;
|
||||
if (oldDigest !== digest) {
|
||||
builder_util_1.log.debug({ oldDigest, newDigest: digest }, "no valid cached executable found");
|
||||
|
|
@ -27,7 +25,7 @@ class BuildCacheManager {
|
|||
}
|
||||
builder_util_1.log.debug({ cacheFile: this.cacheFile, file: this.executableFile }, `copying cached executable`);
|
||||
try {
|
||||
await fs_1.copyFile(this.cacheFile, this.executableFile, false);
|
||||
await (0, builder_util_1.copyFile)(this.cacheFile, this.executableFile, false);
|
||||
return true;
|
||||
}
|
||||
catch (e) {
|
||||
|
|
@ -51,8 +49,8 @@ class BuildCacheManager {
|
|||
this.cacheInfo.executableDigest = this.newDigest;
|
||||
}
|
||||
try {
|
||||
await promises_1.mkdir(this.cacheDir, { recursive: true });
|
||||
await Promise.all([fs_extra_1.writeJson(this.cacheInfoFile, this.cacheInfo), fs_1.copyFile(this.executableFile, this.cacheFile, false)]);
|
||||
await (0, promises_1.mkdir)(this.cacheDir, { recursive: true });
|
||||
await Promise.all([(0, fs_extra_1.writeJson)(this.cacheInfoFile, this.cacheInfo), (0, builder_util_1.copyFile)(this.executableFile, this.cacheFile, false)]);
|
||||
}
|
||||
catch (e) {
|
||||
builder_util_1.log.warn({ error: e.stack || e }, `cannot save build cache`);
|
||||
|
|
@ -63,11 +61,10 @@ exports.BuildCacheManager = BuildCacheManager;
|
|||
BuildCacheManager.VERSION = "0";
|
||||
async function digest(hash, files) {
|
||||
// do not use pipe - better do bulk file read (https://github.com/yarnpkg/yarn/commit/7a63e0d23c46a4564bc06645caf8a59690f04d01)
|
||||
for (const content of await bluebird_lst_1.default.map(files, it => promises_1.readFile(it))) {
|
||||
for (const content of await Promise.all(files.map(it => (0, promises_1.readFile)(it)))) {
|
||||
hash.update(content);
|
||||
}
|
||||
hash.update(BuildCacheManager.VERSION);
|
||||
return hash.digest("base64");
|
||||
}
|
||||
exports.digest = digest;
|
||||
//# sourceMappingURL=cacheManager.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue