From 292688b127a950b4fbec3e10bfa80f2e9b2fe524 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 13 Dec 2022 11:25:04 +0100 Subject: [PATCH] minor fix --- dist/setup/index.js | 10 +++++++--- src/distibutions/base-distribution.ts | 8 ++++---- src/distibutions/official_builds/official_builds.ts | 5 +++++ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index d994595f..bf5973e9 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -73234,6 +73234,9 @@ class BaseDistribution { const toolName = this.getNodejsDistInfo(evaluatedVersion, this.osPlat); toolPath = yield this.downloadNodejs(toolName); } + if (this.osPlat != 'win32') { + toolPath = path.join(toolPath, 'bin'); + } core.addPath(toolPath); }); } @@ -73271,9 +73274,6 @@ class BaseDistribution { } let toolPath = yield this.extractArchive(downloadPath, info); core.info('Done'); - if (osPlat != 'win32') { - toolPath = path.join(toolPath, 'bin'); - } return toolPath; }); } @@ -73565,6 +73565,7 @@ const core = __importStar(__nccwpck_require__(2186)); const tc = __importStar(__nccwpck_require__(7784)); const semver = __importStar(__nccwpck_require__(5911)); const os_1 = __importDefault(__nccwpck_require__(2037)); +const path_1 = __importDefault(__nccwpck_require__(1017)); const base_distribution_1 = __importDefault(__nccwpck_require__(8653)); class OfficialBuilds extends base_distribution_1.default { constructor(nodeInfo) { @@ -73649,6 +73650,9 @@ class OfficialBuilds extends base_distribution_1.default { const toolName = this.getNodejsDistInfo(evaluatedVersion, this.osPlat); toolPath = yield this.downloadNodejs(toolName); } + if (this.osPlat != 'win32') { + toolPath = path_1.default.join(toolPath, 'bin'); + } core.addPath(toolPath); }); } diff --git a/src/distibutions/base-distribution.ts b/src/distibutions/base-distribution.ts index f61e6831..c898602f 100644 --- a/src/distibutions/base-distribution.ts +++ b/src/distibutions/base-distribution.ts @@ -36,6 +36,10 @@ export default abstract class BaseDistribution { toolPath = await this.downloadNodejs(toolName); } + if (this.osPlat != 'win32') { + toolPath = path.join(toolPath, 'bin'); + } + core.addPath(toolPath); } @@ -82,10 +86,6 @@ export default abstract class BaseDistribution { let toolPath = await this.extractArchive(downloadPath, info); core.info('Done'); - if (osPlat != 'win32') { - toolPath = path.join(toolPath, 'bin'); - } - return toolPath; } diff --git a/src/distibutions/official_builds/official_builds.ts b/src/distibutions/official_builds/official_builds.ts index 34304e9f..249fbde0 100644 --- a/src/distibutions/official_builds/official_builds.ts +++ b/src/distibutions/official_builds/official_builds.ts @@ -2,6 +2,7 @@ import * as core from '@actions/core'; import * as tc from '@actions/tool-cache'; import * as semver from 'semver'; import os from 'os'; +import path from 'path'; import {INodeVersion} from '../../installer'; import BaseDistribution from '../base-distribution'; @@ -131,6 +132,10 @@ export default class OfficialBuilds extends BaseDistribution { toolPath = await this.downloadNodejs(toolName); } + if (this.osPlat != 'win32') { + toolPath = path.join(toolPath, 'bin'); + } + core.addPath(toolPath); }