@yao-pkg/pkg-fetch
Advanced tools
Comparing version 3.5.13 to 3.5.14
@@ -149,5 +149,5 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _a, forceFetch, forceBuild, dryRun, output, nodeRange, _b, platform, arch, nodeVersion, fetched, built, remote, fetchFailed; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
var _a, forceFetch, forceBuild, dryRun, output, nodeRange, _b, platform, arch, nodeVersion, fetched, built, remote, fetchFailed, _c; | ||
return __generator(this, function (_d) { | ||
switch (_d.label) { | ||
case 0: | ||
@@ -182,12 +182,18 @@ _a = opts || {}, forceFetch = _a.forceFetch, forceBuild = _a.forceBuild, dryRun = _a.dryRun, output = _a.output, nodeRange = _a.nodeRange; | ||
remote = (0, places_1.remotePlace)({ arch: arch, nodeVersion: nodeVersion, platform: platform, version: package_json_1.version }); | ||
if (!!forceBuild) return [3 /*break*/, 3]; | ||
if (!!forceBuild) return [3 /*break*/, 4]; | ||
return [4 /*yield*/, exists(fetched)]; | ||
case 1: | ||
if (!_c.sent()) return [3 /*break*/, 3]; | ||
if (!_d.sent()) return [3 /*break*/, 4]; | ||
if (dryRun) { | ||
return [2 /*return*/, 'exists']; | ||
} | ||
_c = !!process.env.PKG_NODE_PATH; | ||
if (_c) return [3 /*break*/, 3]; | ||
return [4 /*yield*/, (0, utils_1.hash)(fetched)]; | ||
case 2: | ||
if ((_c.sent()) === expected_1.EXPECTED_HASHES[remote.name]) { | ||
_c = (_d.sent()) === expected_1.EXPECTED_HASHES[remote.name]; | ||
_d.label = 3; | ||
case 3: | ||
// when node path is set, skip hash check | ||
if (_c) { | ||
return [2 /*return*/, fetched]; | ||
@@ -197,8 +203,8 @@ } | ||
fs_extra_1.default.unlinkSync(fetched); | ||
_c.label = 3; | ||
case 3: | ||
if (!!forceFetch) return [3 /*break*/, 5]; | ||
_d.label = 4; | ||
case 4: | ||
if (!!forceFetch) return [3 /*break*/, 6]; | ||
return [4 /*yield*/, exists(built)]; | ||
case 4: | ||
if (_c.sent()) { | ||
case 5: | ||
if (_d.sent()) { | ||
if (dryRun) | ||
@@ -210,13 +216,13 @@ return [2 /*return*/, 'exists']; | ||
} | ||
_c.label = 5; | ||
case 5: | ||
if (!!forceBuild) return [3 /*break*/, 9]; | ||
_d.label = 6; | ||
case 6: | ||
if (!!forceBuild) return [3 /*break*/, 10]; | ||
if (dryRun) | ||
return [2 /*return*/, 'fetched']; | ||
return [4 /*yield*/, download(remote, fetched)]; | ||
case 6: | ||
if (!_c.sent()) return [3 /*break*/, 8]; | ||
case 7: | ||
if (!_d.sent()) return [3 /*break*/, 9]; | ||
return [4 /*yield*/, (0, utils_1.hash)(fetched)]; | ||
case 7: | ||
if ((_c.sent()) === expected_1.EXPECTED_HASHES[remote.name]) { | ||
case 8: | ||
if ((_d.sent()) === expected_1.EXPECTED_HASHES[remote.name]) { | ||
return [2 /*return*/, fetched]; | ||
@@ -226,6 +232,6 @@ } | ||
throw (0, log_1.wasReported)('Binary hash does NOT match.'); | ||
case 8: | ||
case 9: | ||
fetchFailed = true; | ||
_c.label = 9; | ||
case 9: | ||
_d.label = 10; | ||
case 10: | ||
if (!dryRun && fetchFailed) { | ||
@@ -252,4 +258,4 @@ log_1.log.info('Not found in remote cache:', JSON.stringify(remote)); | ||
return [4 /*yield*/, (0, build_1.default)(nodeVersion, arch, platform, built)]; | ||
case 10: | ||
_c.sent(); | ||
case 11: | ||
_d.sent(); | ||
return [2 /*return*/, built]; | ||
@@ -256,0 +262,0 @@ } |
{ | ||
"name": "@yao-pkg/pkg-fetch", | ||
"version": "3.5.13", | ||
"version": "3.5.14", | ||
"description": "Compiles and stores base binaries for pkg", | ||
@@ -5,0 +5,0 @@ "main": "lib-es5/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
270535
1684
22