Skip to content

Commit dd6f5ab

Browse files
only node binary issue
1 parent f7c5caf commit dd6f5ab

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

dist/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12975,7 +12975,6 @@ const io = __importStar(__webpack_require__(1));
1297512975
const tc = __importStar(__webpack_require__(533));
1297612976
const path = __importStar(__webpack_require__(622));
1297712977
const semver = __importStar(__webpack_require__(280));
12978-
const fs = __webpack_require__(747);
1297912978
function getNode(versionSpec, stable, token) {
1298012979
return __awaiter(this, void 0, void 0, function* () {
1298112980
let osPlat = os.platform();
@@ -13005,7 +13004,8 @@ function getNode(versionSpec, stable, token) {
1300513004
}
1300613005
catch (err) {
1300713006
if (err instanceof tc.HTTPError && err.httpStatusCode == 404) {
13008-
return yield acquireNodeFromFallbackLocation(info.resolvedVersion);
13007+
yield acquireNodeFromFallbackLocation(info.resolvedVersion);
13008+
return;
1300913009
}
1301013010
throw err;
1301113011
}
@@ -13015,12 +13015,9 @@ function getNode(versionSpec, stable, token) {
1301513015
let extPath;
1301613016
if (osPlat == 'win32') {
1301713017
let _7zPath = path.join(__dirname, '..', 'externals', '7zr.exe');
13018-
console.log(`downloadPath: ${downloadPath}`, `isFile: ${fs.statSync(downloadPath).isFile()}`);
13019-
console.log(JSON.stringify(fs.statSync(downloadPath)));
1302013018
extPath = yield tc.extract7z(downloadPath, undefined, _7zPath);
1302113019
// 7z extracts to folder matching file name
1302213020
extPath = path.join(extPath, path.basename(info.fileName, '.7z'));
13023-
console.log(`extPath: ${extPath}`, `isDirectory: ${fs.statSync(extPath).isDirectory()}`);
1302413021
}
1302513022
else {
1302613023
extPath = yield tc.extractTar(downloadPath, undefined, [
@@ -13187,6 +13184,7 @@ function acquireNodeFromFallbackLocation(version) {
1318713184
try {
1318813185
exeUrl = `https://nodejs.org/dist/v${version}/win-${osArch}/node.exe`;
1318913186
libUrl = `https://nodejs.org/dist/v${version}/win-${osArch}/node.lib`;
13187+
console.log(`Downloading only node binary from ${exeUrl}`);
1319013188
const exePath = yield tc.downloadTool(exeUrl);
1319113189
yield io.cp(exePath, path.join(tempDir, 'node.exe'));
1319213190
const libPath = yield tc.downloadTool(libUrl);
@@ -13205,7 +13203,9 @@ function acquireNodeFromFallbackLocation(version) {
1320513203
throw err;
1320613204
}
1320713205
}
13208-
return yield tc.cacheDir(tempDir, 'node', version);
13206+
let toolPath = yield tc.cacheDir(tempDir, 'node', version);
13207+
core.addPath(toolPath);
13208+
return toolPath;
1320913209
});
1321013210
}
1321113211
// os.arch does not always match the relative download url, e.g.

src/installer.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ export async function getNode(
6464
downloadPath = await tc.downloadTool(info.downloadUrl, undefined, token);
6565
} catch (err) {
6666
if (err instanceof tc.HTTPError && err.httpStatusCode == 404) {
67-
return await acquireNodeFromFallbackLocation(info.resolvedVersion);
67+
await acquireNodeFromFallbackLocation(info.resolvedVersion);
68+
return;
6869
}
6970

7071
throw err;
@@ -269,6 +270,8 @@ async function acquireNodeFromFallbackLocation(
269270
exeUrl = `https://nodejs.org/dist/v${version}/win-${osArch}/node.exe`;
270271
libUrl = `https://nodejs.org/dist/v${version}/win-${osArch}/node.lib`;
271272

273+
console.log(`Downloading only node binary from ${exeUrl}`);
274+
272275
const exePath = await tc.downloadTool(exeUrl);
273276
await io.cp(exePath, path.join(tempDir, 'node.exe'));
274277
const libPath = await tc.downloadTool(libUrl);
@@ -286,7 +289,9 @@ async function acquireNodeFromFallbackLocation(
286289
throw err;
287290
}
288291
}
289-
return await tc.cacheDir(tempDir, 'node', version);
292+
let toolPath = await tc.cacheDir(tempDir, 'node', version);
293+
core.addPath(toolPath);
294+
return toolPath;
290295
}
291296

292297
// os.arch does not always match the relative download url, e.g.

0 commit comments

Comments
 (0)