From 15798eaae79895846e6d5019bb40a9b4694f83a3 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 13 Dec 2022 16:33:20 +0100 Subject: [PATCH] minor fix --- dist/setup/index.js | 10 ++++++++-- src/distibutions/nightly/nightly_builds.ts | 5 ++++- src/distibutions/v8-canary/canary_builds.ts | 5 ++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 8f1171e0..bb4428a4 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -73483,6 +73483,7 @@ class NightlyNodejs extends base_distribution_1.default { super(nodeInfo); } findVersionInHoostedToolCacheDirectory() { + let toolPath = ''; const localVersionPaths = tc .findAllVersions('node', this.nodeInfo.arch) .filter(i => { @@ -73493,7 +73494,9 @@ class NightlyNodejs extends base_distribution_1.default { return prerelease[0].includes('nightly'); }); const localVersion = this.evaluateVersions(localVersionPaths); - const toolPath = tc.find('node', localVersion, this.nodeInfo.arch); + if (localVersion) { + toolPath = tc.find('node', localVersion, this.nodeInfo.arch); + } return toolPath; } evaluateVersions(versions) { @@ -73833,6 +73836,7 @@ class CanaryBuild extends base_distribution_1.default { super(nodeInfo); } findVersionInHoostedToolCacheDirectory() { + let toolPath = ''; const localVersionPaths = tc .findAllVersions('node', this.nodeInfo.arch) .filter(i => { @@ -73843,7 +73847,9 @@ class CanaryBuild extends base_distribution_1.default { return prerelease[0].includes('v8-canary'); }); const localVersion = this.evaluateVersions(localVersionPaths); - const toolPath = tc.find('node', localVersion, this.nodeInfo.arch); + if (localVersion) { + toolPath = tc.find('node', localVersion, this.nodeInfo.arch); + } return toolPath; } getDistributionUrl() { diff --git a/src/distibutions/nightly/nightly_builds.ts b/src/distibutions/nightly/nightly_builds.ts index d563fe6a..ff8e824e 100644 --- a/src/distibutions/nightly/nightly_builds.ts +++ b/src/distibutions/nightly/nightly_builds.ts @@ -12,6 +12,7 @@ export default class NightlyNodejs extends BaseDistribution { } protected findVersionInHoostedToolCacheDirectory(): string { + let toolPath = ''; const localVersionPaths = tc .findAllVersions('node', this.nodeInfo.arch) .filter(i => { @@ -23,7 +24,9 @@ export default class NightlyNodejs extends BaseDistribution { return prerelease[0].includes('nightly'); }); const localVersion = this.evaluateVersions(localVersionPaths); - const toolPath = tc.find('node', localVersion, this.nodeInfo.arch); + if (localVersion) { + toolPath = tc.find('node', localVersion, this.nodeInfo.arch); + } return toolPath; } diff --git a/src/distibutions/v8-canary/canary_builds.ts b/src/distibutions/v8-canary/canary_builds.ts index e363bde9..12d23eac 100644 --- a/src/distibutions/v8-canary/canary_builds.ts +++ b/src/distibutions/v8-canary/canary_builds.ts @@ -12,6 +12,7 @@ export default class CanaryBuild extends BaseDistribution { } protected findVersionInHoostedToolCacheDirectory(): string { + let toolPath = ''; const localVersionPaths = tc .findAllVersions('node', this.nodeInfo.arch) .filter(i => { @@ -24,7 +25,9 @@ export default class CanaryBuild extends BaseDistribution { }); const localVersion = this.evaluateVersions(localVersionPaths); - const toolPath = tc.find('node', localVersion, this.nodeInfo.arch); + if (localVersion) { + toolPath = tc.find('node', localVersion, this.nodeInfo.arch); + } return toolPath; }