From 0db4699b29675e7bc6be5d655d4b8aa7decc7bc7 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Aug 2022 11:24:08 +0200 Subject: [PATCH] Build index.js --- dist/setup/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 0a0c0bad..d7fd9f84 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -71770,13 +71770,13 @@ function translateArchToDistUrl(arch) { function parseNodeVersionFile(contents) { var _a, _b; let nodeVersion; - const found = contents.match(/^(?:nodejs\s+)?v?(?[^\s]+)$/m); - nodeVersion = (_a = found === null || found === void 0 ? void 0 : found.groups) === null || _a === void 0 ? void 0 : _a.version; + // Try parsing the file as an NPM `package.json` + // file. + nodeVersion = (_a = JSON.parse(contents).engines) === null || _a === void 0 ? void 0 : _a.node; if (!nodeVersion) { try { - // Try parsing the file as an NPM `package.json` - // file. - nodeVersion = (_b = JSON.parse(contents).engines) === null || _b === void 0 ? void 0 : _b.node; + const found = contents.match(/^(?:nodejs\s+)?v?(?[^\s]+)$/m); + nodeVersion = (_b = found === null || found === void 0 ? void 0 : found.groups) === null || _b === void 0 ? void 0 : _b.version; if (!nodeVersion) throw new Error(); }